Re: [PHP4BETA] calling an undefined function with @ shoud give an error!!!

From: Date: Wed, 12 May 1999 20:43:39 +0000
Subject: Re: [PHP4BETA] calling an undefined function with @ shoud give an error!!!
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-819@lists.php.net to get a copy of this message
At 20:13 12/05/99 , Thies C. Arntzen wrote:
On Wed, 12 May 1999, Zeev Suraski wrote: At 19:35 12/05/99 , Thies C. Arntzen wrote:
doing <?php $tubu = @fopen("kfjsdk","r"); causes php4 to silently exit - i think that fatal errors should always get printed???
No, you're only supposed to use @ if you know what you're doing. You must be able to rely on @ to shut up any error you don't want the users to see. are you sure that we want this behaviour on "ungraceful" shutdowns of the engine???? ok, but then an undefined function-call should not cause parser/excutor exit... or - maybe we should at least enable it as long as we don't have all the basic things working....
The question is, why would you use the @ prefix unless you want to shut up a particular function that you know about beforehand? If you just want all functions to shut up, you'd use error_reporting(0). The reason we bail out on an undefined function is both technical and practical. The technical side can be summarized by saying that by the time we make the last effort to find the function, we've already done enough things to make it pretty difficult to roll back without actually calling the function. But practically, there are virtually no situations in which you'd want a script that called a non existent function to go on running - it'll definitely not perform as intended anyway. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il -- PHP 4 Beta

« previous php.version4 (#819) next »