Why is this simple hello world PHP code not working?
- by Silva
class saySomething {
var $helloWorld = 'hello world';
function sayHelloWorld($helloWorld)
{
echo $helloWorld;
}
}
$saySomething = new saySomething();
$saySomething->sayHelloWorld();
the above gives this error:
Warning: Missing argument 1 for saySomething::sayHelloWorld(), called in C:\xampp\htdocs\test.php on line 15 and defined in C:\xampp\htdocs\test.php on line 7