3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyClass { function aMethod() { echo "Hello"; } } (new MyClass ())->aMethod(); $arr = [1,2,3,aaa,bbb]; echo $arr[1];
Output for 7.2.0 - 7.3.0rc4
Hello Warning: Use of undefined constant aaa - assumed 'aaa' (this will throw an Error in a future version of PHP) in /in/9K5UP on line 8 Warning: Use of undefined constant bbb - assumed 'bbb' (this will throw an Error in a future version of PHP) in /in/9K5UP on line 8 2
Output for 5.4.0 - 7.1.20
Hello Notice: Use of undefined constant aaa - assumed 'aaa' in /in/9K5UP on line 8 Notice: Use of undefined constant bbb - assumed 'bbb' in /in/9K5UP on line 8 2
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/9K5UP on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/9K5UP on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/9K5UP on line 7
Process exited with code 255.