From: lars_stegelitz at col dot wunderman dot com
Operating system: Windows
PHP version: 4.3.9
PHP Bug Type: Output Control
Bug description: echo a variable that was unset before breaks output
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 bug report at http://bugs.php.net/?id=31010&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31010&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31010&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31010&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31010&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31010&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31010&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31010&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31010&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31010&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31010&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31010&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31010&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31010&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31010&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31010&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31010&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31010&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31010&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31010&r=mysqlcfg