Why is this simple hello world PHP code not working?
Posted
by
Silva
on Stack Overflow
See other posts from Stack Overflow
or by Silva
Published on 2011-02-13T07:01:01Z
Indexed on
2011/02/13
7:25 UTC
Read the original article
Hit count: 162
php
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
© Stack Overflow or respective owner