3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = new StdClass(); $x->{'todo-list'} = 'fred'; $key = 'todo-list'; $nokey = 'as-hsd'; print $x->$key; print $x->$nokey; var_dump($x);
Output for 5.2.6 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
fred Notice: Undefined property: stdClass::$as-hsd in /in/HgTNc on line 11 object(stdClass)#1 (1) { ["todo-list"]=> string(4) "fred" }
Output for 5.0.0 - 5.2.5
fred Notice: Undefined property: stdClass::$as-hsd in /in/HgTNc on line 11 object(stdClass)#1 (1) { ["todo-list"]=> string(4) "fred" }
Output for 4.3.0 - 4.4.9
fred Notice: Undefined property: as-hsd in /in/HgTNc on line 11 object(stdClass)(1) { ["todo-list"]=> string(4) "fred" }