3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FooClass { } $foo = new FooClass(); $foo->bar = "qux"; $thing = "bar"; $qux = "th"; $grault = "ing"; function th($waldo){ global $qux, $grault, $thing; return ${$qux.$grault}.$waldo; } echo ${($foo->${${$foo->bar}.((${qux}.${grault}===$qux.${grault})?${grault}:${$qux.$grault})})}(($foo->${${$foo->bar}.((${qux}.${grault}===$qux.${grault})?${grault}:${$qux.$grault})}));
Output for 7.2.0 - 7.3.0rc6
Warning: Use of undefined constant qux - assumed 'qux' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant grault - assumed 'grault' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant grault - assumed 'grault' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant grault - assumed 'grault' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant qux - assumed 'qux' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant grault - assumed 'grault' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant grault - assumed 'grault' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 Warning: Use of undefined constant grault - assumed 'grault' (this will throw an Error in a future version of PHP) in /in/TjEoJ on line 16 barqux
Output for 4.3.0 - 7.1.20
Notice: Use of undefined constant qux - assumed 'qux' in /in/TjEoJ on line 16 Notice: Use of undefined constant grault - assumed 'grault' in /in/TjEoJ on line 16 Notice: Use of undefined constant grault - assumed 'grault' in /in/TjEoJ on line 16 Notice: Use of undefined constant grault - assumed 'grault' in /in/TjEoJ on line 16 Notice: Use of undefined constant qux - assumed 'qux' in /in/TjEoJ on line 16 Notice: Use of undefined constant grault - assumed 'grault' in /in/TjEoJ on line 16 Notice: Use of undefined constant grault - assumed 'grault' in /in/TjEoJ on line 16 Notice: Use of undefined constant grault - assumed 'grault' in /in/TjEoJ on line 16 barqux