|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-12-07 16:31 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
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