ID: 24436 Updated by: [EMAIL PROTECTED] Reported By: Nico dot Laus dot 2002 at gmx dot de -Status: Bogus +Status: Open -Bug Type: Class/Object related +Bug Type: Zend Engine 2 problem Operating System: WinXP SP1 PHP Version: 5CVS-2003-07-01 (dev) New Comment:
Ah, no, that was my fault, it gives errors now. But no errors *at all* with this: <?php error_reporting(E_ALL); class test { function __construct() { if (empty($this->test[0][0])) { print "test1\n";} if (!isset($this->test[0][0])) { print "test2\n";} if (empty($this->test)) { print "test1\n";} if (!isset($this->test)) { print "test2\n";} } } $test1 = new test(); ?> Here it should have given 3 errors, for both the [0][0] ones, and the empty($this->test) one. Previous Comments: ------------------------------------------------------------------------ [2003-07-01 09:25:03] Nico dot Laus dot 2001 at gmx dot de is your error_reporting set to E_ALL? -> then it should display them, too of course I can disable showing NOTICE-errors, but I'll better show/log them to find possible bugs ------------------------------------------------------------------------ [2003-07-01 09:06:24] [EMAIL PROTECTED] It's weird though... I can't get it to show errors at all here anyway... ------------------------------------------------------------------------ [2003-07-01 08:39:37] Nico dot Laus dot 2001 at gmx dot de of course using $this->test should display an error, but by checking whether it exists, too?? -> as I said, in earlier versions this has not returned an error ------------------------------------------------------------------------ [2003-07-01 08:36:31] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php $this->test doesn\'t exist... of course it should give a warning... ------------------------------------------------------------------------ [2003-07-01 08:34:30] Nico dot Laus dot 2002 at gmx dot de Description: ------------ When checking variables either not declared or after having unset() them with empty() or isset(), some errors occure. In former times, empty() and isset() have not produced errors - even if it is a NOTICE now. -> hopefully this is not the way it is meant to be - I think, than it's not only me who has to rewrite his code Reproduce code: --------------- class test { function __construct() { if (empty($this->test[0][0])) { print "test1";} if (!isset($this->test[0][0])) { print "test2";} } } $test1 = new test(); Expected result: ---------------- test1test2 Actual result: -------------- Notice: Undefined property: test::$test in D:\inetpub\wwwroot\fmwars\temp.php on line 41 test1Notice: Undefined property: test::$test in D:\inetpub\wwwroot\fmwars\temp.php on line 42 test2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24436&edit=1