3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); class a { static function a() { echo "CONSTRUCTOR CALLED\r\n"; } function b($var) { return $var . 'x'; } } print_r(array_map(array('a', 'b'), array('a', 'b')));
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.30, 7.2.0 - 7.2.20, 7.3.0 - 7.3.7
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; a has a deprecated constructor in /in/Rr4sI on line 5 Fatal error: Constructor a::a() cannot be static in /in/Rr4sI on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Fatal error: Constructor a::a() cannot be static in /in/Rr4sI on line 13
Process exited with code 255.

preferences:
127.85 ms | 402 KiB | 179 Q