3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function __construct() { a = "hello"; b = "hi"; val = "howdy"; $val = 'a'; echo $sally->{$val}; // outputs "hello" echo "\n"; $val = "b"; echo $sally->{$val}; // outputs "hi" echo "\n"; echo $sally->val; //outputs "howdy" echo "\n"; echo $sally->{"val"}; } } $foo = new foo();
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '=' in /in/9D4Ei on line 5
Process exited with code 255.