3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "C#maj7"; $qualityVal = ""; if (true) { $qualityVal .= substr($string, 2); } $num = 10; $num += 10; class Hello { public world; public function __toString() { return "Hello!"; } } $hello = new Hello(); $world = "world"; echo $hello->$world; ?>
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'world' (T_STRING), expecting variable (T_VARIABLE) in /in/6KsBJ on line 10
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/6KsBJ on line 10
Process exited with code 255.

preferences:
183.76 ms | 1395 KiB | 62 Q