Date: 02/27/01
- Next message: amra <email protected>: "[PHP-DEV] PHP 4.0 Bug #9469 Updated: HAVE_REALPATH not being checked"
- Previous message: cparris82 <email protected>: "[PHP-DEV] PHP 4.0 Bug #9480: PHP segmentation fault"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: phil <email protected>
Operating system: Linux (Redhat 6.2) on an i686
PHP version: 4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description: Passing out class property by reference problem
<?
function xmpdump($xValue, $sLabel="")
{
echo "$sLabel<xmp>";
var_dump($xValue);
echo "</xmp>";
}
class test
{
var $sValue;
var $Count = 0;
function getTest(&$refObj)
{
if (isset($this->sValue))
{
$refObj = &$this->sValue;
xmpdump($refObj, "Reference before being passed back");
return;
}
else
{
$refObj = "phil".$this->Count;
$this->Count++;
$this->sValue = &$refObj;
xmpdump($refObj, "Value before being passed back");
return;
}
}
}
$tst = new test();
$tst->getTest($tstObj0);
xmpdump($tstObj0, "Value after being passed back");
$tst->getTest($tstObj1);
xmpdump($tstObj1, "Refence after being passed back");
?>
The dump of $tstObj1 is NULL, despite the dump of $refObj immediately before it in the function working correctly.
-- Edit Bug report at: http://bugs.php.net/?id=9481&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: amra <email protected>: "[PHP-DEV] PHP 4.0 Bug #9469 Updated: HAVE_REALPATH not being checked"
- Previous message: cparris82 <email protected>: "[PHP-DEV] PHP 4.0 Bug #9480: PHP segmentation fault"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

