3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo const BAR = 1; public function doSomething() { echo $this::BAR; } } $f = new Foo; $f->doSomething();
Output for 5.4.0 - 5.4.7
Parse error: syntax error, unexpected 'const' (T_CONST), expecting '{' in /in/mUlj4 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.17
Parse error: syntax error, unexpected T_CONST, expecting '{' in /in/mUlj4 on line 3
Process exited with code 255.

preferences:
152.35 ms | 1395 KiB | 33 Q