3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Bar { public static function dump() { var_dump( '__CLASS__: ' . __CLASS__, 'self::class: ' . self::class, 'static::class: ' . static::class, 'self::foo(): ' . self::foo()); } } class Foo { use Bar; public static foo() { return __CLASS__; } } Foo::dump();
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/4eJlJ on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/4eJlJ on line 3
Process exited with code 255.

preferences:
185.66 ms | 1395 KiB | 67 Q