Mantis - Quercus
Viewing Issue Advanced Details
3857 minor always 01-22-10 17:27 02-04-10 12:03
nam  
 
normal  
closed 4.0.2  
fixed  
none    
none 4.0.4  
0003857: vbulletin - incorrect evaluation order of $this->{$table}["$fieldname"]
(rep by mrtom)

http://forum.caucho.com/showthread.php?t=3316 [^]

<?php

class A
{
  var $foo = array();

  function test()
  {
    $bar = "123";
  
    $fieldname = "myName";
    $table = "foo";
  
    $this->{$table}["$fieldname"] = &$bar;
    
    var_dump($this->foo);
  }
  
  function test2()
  {
    $bar = "123";
  
    $fieldname = "myName";
    $table = "foo";
  
    $arr = $this->{$table};
    $arr["$fieldname"] = &$bar;
    
    var_dump($this->foo);
  }
}

$a0 = new A();
$a1 = new A();

$a0->test();
$a1->test2();

?>

Notes
(0004394)
ferg   
01-28-10 09:21   
This is a great bug report. Thanks for the details!
(0004413)
emil   
02-04-10 12:03   
php/098c