/* there’s no place like code */

echo is diffe­rent state­ment, than print

Originally posted at saji-codes tumblr.

<?php
true && echo 'ok';

fails with

Parse error: syntax error, unexpected T_ECHO in /home/saji/foo.php on line 2

but

<?php
true && print 'ok';

works just fine

Update

<?php
echo echo 'ok';

also fails. It seems that things has changed in php-5.3 and echo does not return true anymore. Weird that print does, thought.