3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StaticNaming { public static function whyNot(): ? Aye {} public function whyNot(): ? Aye {} } class ACommandThatCanWerkStatically { public function __construct( public string $template ) {} public function execute(Dictionary $nameToReplacementMap): string {} public static function execute(string $template, Dictionary $nameToReplacementMap): string {} } $template = new ACommandThatCanWerkStatically('@@@VERSION@@@'); echo ACommandThatCanWerkStatically::execute( $template->template, $nameToReplacementMap = array('VERSION' => '0.0.1-alpha0') ), "\n"; echo $template->execute($nameToReplacementMap), "\n";
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Cannot redeclare StaticNaming::whyNot() in /in/7H4Ro on line 6
Process exited with code 255.

preferences:
158.85 ms | 1067 KiB | 8 Q