3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public $bar = 'barValue'; protected $baz = 'bazValue'; private $tab = 'tabValue'; } $F = new Foo(); var_dump($F); $data = (array)$F; var_dump($data["bar"]); var_dump($data["\0*\0baz"]); var_dump($data["\0Foo\0tab"]); $data['\0Foo\0tab'] = "new_tabValue"; $F = (new Foo())$data; var_dump($F);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '$data' (T_VARIABLE) in /in/udbVf on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/udbVf on line 20
Process exited with code 255.