ID: 29767
User updated by: morten at nilsen dot com
Reported By: morten at nilsen dot com
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Linux
PHP Version: 5.0.1
New Comment:
(obvious) workaround is to change:
if($name[0] != '&') $name = '&'.$name.';';
into:
$entity = "&$name;";
Previous Comments:
------------------------------------------------------------------------
[2004-08-20 03:55:51] morten at nilsen dot com
Description:
------------
The attached script behaves ilogically
Reproduce code:
---------------
<?php
class template {
function __set($name, $value) {
echo "Set $name to $value<br>";
if($name[0] != '&') $name = '&'.$name.';';
}
}
function fetchlist($name) {
global $template;
echo '$template->what = '.$name.'<br>';
$template->what = $name;
}
$template = new template();
fetchlist('user');
fetchlist('group');
?>
Expected result:
----------------
$template->what = user
Set what to user
$template->what = group
Set what to group
Actual result:
--------------
$template->what = user
Set what to user
$template->what = group
Set &what; to group
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29767&edit=1