<?php
class A
{
public $x=40;
function sum($x)
{
return $this->x + $this->x;
}
public function __construct()
{
echo "The class ".__class__." has been created<br>";
}
function sub($integers)
{
echo 2*$integers."<br>";
}
}
$obj= new A;
//Will the 40 in paranthesis will be passed as argument to the function sum($x) above?
echo $obj->sum(40); //It throws an error if I don't pass anything in sum but it will not take 50 it is taking 40
$obj->sub(50);
?>