3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { static $gen = 0; function test(){ var_dump(self::$gen++); var_dump(static::$gen++); var_dump(\X::$gen++); var_dump(__CLASS__::$gen++); // :/ } } $x = new X; $x->test();
Output for 7.0.0 - 7.0.11
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM), expecting ',' or ')' in /in/hVF16 on line 10
Process exited with code 255.
Output for 5.6.0 - 5.6.26
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/hVF16 on line 10
Process exited with code 255.

preferences:
174.31 ms | 1395 KiB | 46 Q