<?php class cat { function say() { echo 'meow' . PHP_EOL; } } class dog { function say() { echo 'woof' . PHP_EOL; } } $cat = new cat();
Standard input is empty
woof woof meow
PHP Warning: Use of undefined constant dog - assumed 'dog' (this will throw an Error in a future version of PHP) in /home/dzJBTN/prog.php on line 15 PHP Warning: Use of undefined constant dog - assumed 'dog' (this will throw an Error in a future version of PHP) in /home/dzJBTN/prog.php on line 16