3v4l.org

run code in 300+ PHP versions simultaneously
<?php $version = []; $version['extra'] = 'TEST'; $fileContents = <<<EOT const EXTRA_VERSION = 'beta5-dev'; EOT; echo preg_replace("#EXTRA_VERSION\s*=\s*'[^\']*'#", "EXTRA_VERSION = '" . $version['extra'] . "'", $fileContents); echo "\n\n"; echo preg_replace("#EXTRA_VERSION\s*=\s*'[^']*'#", "EXTRA_VERSION = '" . $version['extra'] . "'", $fileContents);

preferences:
29.03 ms | 404 KiB | 5 Q