ID: 31010 Updated by: [EMAIL PROTECTED] Reported By: lars_stegelitz at col dot wunderman dot com -Status: Verified +Status: Feedback Bug Type: Class/Object related Operating System: * PHP Version: 4CVS-2005-06-27 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2004-12-08 07:56:32] [EMAIL PROTECTED] Most likely the lack of output is because there is a crash in PHP, backtrace as follows: [Switching to Thread 1087948032 (LWP 19451)] 0x082a359c in execute (op_array=0x8624c4c) at /usr/src/web/php/php4/Zend/zend_execute.c:1370 1370 PZVAL_UNLOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); (gdb) bt #0 0x082a359c in execute (op_array=0x8624c4c) at /usr/src/web/php/php4/Zend/zend_execute.c:1370 #1 0x08290eed in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php4/Zend/zend.c:900 #2 0x082589f9 in php_execute_script (primary_file=0xbfffe490) at /usr/src/web/php/php4/main/main.c:1736 #3 0x082b68e9 in main (argc=2, argv=0xbfffe524) at /usr/src/web/php/php4/sapi/cli/php_cli.c:822 #4 0x42015704 in __libc_start_main () from /lib/tls/libc.so.6 ------------------------------------------------------------------------ [2004-12-07 16:38:58] lars_stegelitz at col dot wunderman dot com addition: The error-suppression operator (@) in the __set/__get methods should be omitted to see a warning in standard cases. However, it makes no difference in case of the mentioned error... ------------------------------------------------------------------------ [2004-12-07 16:31:21] lars_stegelitz at col dot wunderman dot com Description: ------------ When trying to echo an variable that was previously unset, no output at all is shown. I wrote a small test case (see below) Reproduce code: --------------- class Test { var $values; function Test() { $this->values = array(); } function __get($key, &$value) { $value = @$this->values[$key]; return true; } function __set($key, $value) { $this->values[$key] = @$value; return true; } } overload('Test'); $test = new Test(); $test->xyz = "test"; echo "<br/>1. {$test->xyz}"; unset($test->values['xyz']); echo "<br/>2. {$test->xyz}"; Expected result: ---------------- 1. test Notice: Undefined variable: xyz in <sourcecode> on line <x> 2. Actual result: -------------- Nothing. No output at all. No warning or error in log files or on screen. Not even the echo *before* unsetting the variable shows up. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31010&edit=1
