3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $piyo = Hoge::$array; $piyo[] = 1; class Hoge { const ZERO = 0; public static $array = array(self::ZERO => 'hoge'); }
based on F728l
Output for 5.1.0 - 5.4.32, 5.5.0 - 5.5.16, 5.5.23 - 7.3.0rc4
Output for 5.4.34 - 5.4.45, 5.5.18 - 5.5.22
Warning: Cannot add element to the array as the next element is already occupied in /in/d8nBF on line 4
Output for 5.0.0 - 5.0.5
Fatal error: Cannot access self:: when no class scope is active in /in/d8nBF on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ';', expecting '(' in /in/d8nBF on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ';', expecting '(' in /in/d8nBF on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/d8nBF on line 3
Process exited with code 255.