3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = sys_get_temp_dir() . '/gh10232-base'; if (!is_dir($base)) { mkdir($base) or die; } $files = [ 'gh10232.php' => <<<'END' <?php set_include_path('gh10232-nonexistent') or exit(1); chdir(__DIR__) or exit(1); spl_autoload_register(function () { trigger_error(__LINE__); $ex = new Exception(); echo 'Exception on line ', $ex->getLine(), "\n"; require_once __DIR__ . '/gh10232/constant_def.inc'; }, true); class ConstantRef { public const VALUE = ConstantDef::VALUE; } ConstantRef::VALUE; END, 'gh10232/constant_def.inc' => <<<'END' <?php trigger_error(basename(__FILE__)); $ex = new Exception(); echo 'Exception in ', basename($ex->getFile()), ' on line ', $ex->getLine(), "\n"; require_once 'required.inc'; // The script of the same directory. class ConstantDef { const VALUE = true; } END, 'gh10232/required.inc' => <<<'END' <?php trigger_error(basename(__FILE__)); $ex = new Exception(); echo 'Exception in ', basename($ex->getFile()), ' on line ', $ex->getLine(), "\n"; END, ]; foreach ($files as $path => $content) { $path = $base . '/' . $path; if (!is_dir(dirname($path))) { mkdir(dirname($path)); } file_put_contents($path, $content); } require_once $base . '/' . (function_exists('array_key_first') ? array_key_first($files) : key($files));

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.00.0130.01020.14
8.4.150.0010.00114.05
8.4.140.0120.00917.79
8.4.130.0160.00518.90
8.4.120.0120.00920.48
8.4.110.0120.00824.34
8.4.100.0130.00917.97
8.4.90.0080.01320.80
8.4.80.0100.00718.72
8.4.70.0060.00218.90
8.4.60.0160.00720.38
8.4.50.0110.01018.71
8.4.40.0100.00317.87
8.4.30.0100.01020.32
8.4.20.0060.00919.70
8.4.10.0110.01119.48
8.3.280.0100.01218.37
8.3.270.0150.00616.75
8.3.260.0110.01116.52
8.3.250.0100.00816.87
8.3.240.0140.00716.61
8.3.230.0060.00316.63
8.3.220.0130.00619.12
8.3.210.0060.01316.86
8.3.200.0050.00516.68
8.3.190.0110.00917.36
8.3.180.0060.01018.91
8.3.170.0070.01016.77
8.3.160.0000.01917.31
8.3.150.0040.00419.00
8.3.140.0030.00518.75
8.3.130.0040.00418.48
8.3.120.0130.00319.23
8.3.110.0060.00320.94
8.3.100.0040.00824.06
8.3.90.0160.00326.77
8.3.80.0060.00317.97
8.3.70.0030.01318.81
8.3.60.0270.00522.19
8.3.50.0150.00521.37
8.3.40.0190.00923.79
8.3.30.0220.00823.03
8.3.20.0340.00725.79
8.3.10.0220.00925.79
8.3.00.0270.00825.79
8.2.290.0080.00318.55
8.2.280.0040.00420.63
8.2.270.0060.01222.44
8.2.260.0080.01116.91
8.2.250.0080.00017.11
8.2.240.0030.00617.18
8.2.230.0060.00322.58
8.2.220.0070.00337.54
8.2.210.0160.00326.77
8.2.200.0100.00318.29
8.2.190.0100.01016.63
8.2.180.0220.00921.21
8.2.170.0190.00922.43
8.2.160.0150.01124.44
8.2.150.0260.00725.79
8.2.140.0270.00225.79
8.2.130.0200.01325.79
8.2.120.0190.00925.79
8.2.110.0210.00925.79
8.2.100.0250.00925.79
8.2.90.0250.00825.79
8.2.80.0170.01425.79
8.2.70.0290.00325.79
8.2.60.0250.00725.79
8.2.50.0250.00625.79
8.2.40.0300.00225.79
8.2.30.0230.00725.79
8.2.20.0210.01125.79
8.2.10.0280.00325.79
8.2.00.0230.01225.79
8.1.330.0110.00916.19
8.1.320.0100.00918.25
8.1.310.0060.01316.82
8.1.300.0130.00720.30
8.1.290.0090.00030.84
8.1.280.0250.00625.92
8.1.270.0220.01025.79
8.1.260.0250.00825.79
8.1.250.0250.00225.79
8.1.240.0270.00325.79
8.1.230.0350.00925.79
8.1.220.0210.01325.79
8.1.210.0290.00325.79
8.1.200.0210.00825.79
8.1.190.0210.00825.79
8.1.180.0270.00525.79
8.1.170.0300.00425.79
8.1.160.0290.00325.79
8.1.150.0270.00125.79
8.1.140.0210.00725.79
8.1.130.0180.00925.79
8.1.120.0200.00825.79
8.1.110.0230.00725.79
8.1.100.0210.01025.79
8.1.90.0250.00325.79
8.1.80.0220.00625.79
8.1.70.0240.00325.79
8.1.60.0310.00525.79
8.1.50.0340.00625.79
8.1.40.0290.00925.79
8.1.30.0330.00525.79
8.1.20.0250.00925.79
8.1.10.0260.01025.79
8.1.00.0270.00625.79

preferences:
31.54 ms | 403 KiB | 5 Q