3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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 ACommandThatCanWerkStatically::execute() in /in/k8Npg on line 11
Process exited with code 255.

preferences:
160.94 ms | 996 KiB | 7 Q