3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyTable { private name; private id; public function __set($p, $v) { # $this->{$p} = $v; return $this->$p(); } private function name() { return 'x'; } } $oMyTable = new MyTable(); $o = {$oMyTable->name = 'Felipe'}; var_dump($o); $o = $oMyTable->id = '2'; var_dump($o); ?>
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected 'name' (T_STRING), expecting variable (T_VARIABLE) in /in/fCbk9 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/fCbk9 on line 5
Process exited with code 255.