Re: builtin functions / constructs
| From: | Zeev Suraski | Date: | Fri, 23 Mar 2001 16:19:13 +0000 |
| Subject: | Re: builtin functions / constructs | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-49826@lists.php.net to get a copy of this message | ||
unset() is not a function, and using it has very different semantics than a function call (e.g., you can't use unset() as a part of a bigger expression, but only as a full 'unset();' statement). There aren't too many built-in constructs that behave exactly like functions, as a matter of fact, I don't think there are any. The ones that come close:
- isset() and empty() - their different semantics is that they won't display a warning when fed a non existent argument (regardless of error reporting).
- print, include, require - do not require parentheses
- echo - does not require parentheses, and still accepts a coma-separated list of arguments
At 17:12 23/3/2001, Hartmut Holzgraefe wrote:
Stefan Livieratos wrote: "Hartmut Holzgraefe" <hartmut@six.de> schrieb im Newsbeitrag-- Zeev Suraski <zeev@zend.com> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/does this return things like unset()? no it doesn't! there's a difference between builtin functions and language constructsYou are right of course. I was misled by the example Cynic used. On the other hand I don't know how useful a function that returns all language constructs would be. Could someone give me an example for using such a function in a sensible way? i just wanted to show that there are things that look like functions but aren't i'd suggest that those few should be added to the result of get_defined_functions, either under 'internal' or as a third block 'constructs' -- Hartmut Holzgraefe hartmut@six.de http://www.six.de +49-711-99091-77 Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net