note 105138 deleted from function.echo by googleguy

From: Date: Wed, 22 Jan 2014 20:52:55 +0000
Subject: note 105138 deleted from function.echo by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-198307@lists.php.net to get a copy of this message
Note Submitter: fire at dls dot net ---- Pay attention to this part of the documentation: echo() (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function I was trying to make certain that I was detecting errors and was trying code like this: @alwaysFails() or echo('Surprise! It failed again'); This error was generated: [29-Jul-2011 12:56:19] PHP Parse error: syntax error, unexpected T_ECHO in /Applications/MAMP/test.php on line 12 Changing to die(), print() or a function I defined worked fine. Beware of this limitation of echo.

« previous php.notes (#198307) next »