3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { static function foo() { echo __METHOD__.PHP_EOL;} } ['x', 'foo'](); [0 => 'x', 1 => 'foo'](); //Array callback has to contain indices 0 and 1 //[10 => 'x', 11 => 'foo'](); //Array callback must have exactly two elements //[10 => 'x', 11 => 'foo', 0 =>0, 1=>1](); // OK! [1 => 'foo', 0 => 'x']();
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
x::foo x::foo x::foo

preferences:
50.82 ms | 847 KiB | 4 Q