3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ public static $role = 3; public static $factory = self::$role; } print_r(Test::$factory);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '$role' (T_VARIABLE), expecting identifier (T_STRING) in /in/T7Yfs on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/T7Yfs on line 5
Process exited with code 255.

preferences:
184.53 ms | 1395 KiB | 66 Q