3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); /* * PHP 8.0+ throw exception in error handler while proc_open executable not in path warning exit code 127 (shell/system) */ error_reporting(~0); function error_handler($code, $message, $file, $line) { fprintf(STDOUT, "error: %s ** and throw **\n", var_export(array_slice(func_get_args(), 0, 4), true)); throw new ErrorException($message, 0, $code, $file, $line); // non-catchable non-fatal exception } set_error_handler('error_handler', ~0); $pipes = []; // command must be passed as array to trigger this, string won't work. $process = proc_open(['non-existent-command'], [], $pipes); // directly produce some output fprintf(STDOUT, "open: %d\n", $process); $status = proc_get_status($process); ksort($status); fprintf(STDOUT, "status: %s\n", json_encode($status)); // let proc finish usleep(100000); $status = proc_get_status($process); ksort($status); fprintf(STDOUT, "status: %s\n", json_encode($status)); $close = proc_close($process); fprintf(STDOUT, "close: %s\n", var_export($close, true));

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.30.0120.00719.64
8.5.20.0090.01219.54
8.5.10.0080.00921.68
8.5.00.0130.00920.13
8.4.180.0140.00819.74
8.4.170.0130.00920.50
8.4.160.0110.01123.85
8.4.150.0080.00516.94
8.4.140.0120.00917.59
8.4.130.0080.00717.82
8.4.120.0070.00924.16
8.4.110.0110.00622.50
8.4.100.0150.00518.86
8.4.90.0120.00819.10
8.4.80.0110.00920.22
8.4.70.0080.00317.97
8.4.60.0090.01218.81
8.4.50.0130.00718.70
8.4.40.0110.00719.88
8.4.30.0070.01120.38
8.4.20.0130.00722.38
8.4.10.0130.00623.67
8.3.300.0150.00821.07
8.3.290.0090.01220.92
8.3.280.0100.01018.45
8.3.270.0090.01016.45
8.3.260.0090.01116.79
8.3.250.0080.00618.95
8.3.240.0100.00917.20
8.3.230.0110.00916.62
8.3.220.0070.01118.92
8.3.210.0090.00618.34
8.3.200.0040.00416.44
8.3.190.0120.00616.85
8.3.180.0120.00717.00
8.3.170.0090.00920.47
8.3.160.0140.00317.08
8.3.150.0120.00616.83
8.3.140.0150.00316.73
8.3.130.0080.00018.16
8.3.120.0100.00618.96
8.3.110.0030.00620.94
8.3.100.0000.00816.68
8.3.90.0080.00026.77
8.3.80.0060.00318.55
8.3.70.0190.00316.67
8.3.60.0140.00418.56
8.3.50.0060.00916.57
8.3.40.0090.00620.21
8.3.30.0040.01118.70
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.300.0110.00822.18
8.2.290.0140.00520.30
8.2.280.0040.00518.55
8.2.270.0050.00517.59
8.2.260.0100.00716.66
8.2.250.0080.00018.51
8.2.240.0030.00618.82
8.2.230.0030.00622.58
8.2.220.0040.00424.06
8.2.210.0030.00526.77
8.2.200.0090.00016.88
8.2.190.0150.00316.63
8.2.180.0130.00616.88
8.2.170.0090.00618.79
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0030.00626.16
8.2.120.0040.00426.16
8.2.110.0100.00020.35
8.2.100.0040.00817.72
8.2.90.0040.00419.03
8.2.80.0040.00417.97
8.2.70.0050.00317.75
8.2.60.0050.00317.80
8.2.50.0030.00718.07
8.2.40.0040.00419.82
8.2.30.0060.00318.03
8.2.20.0050.00219.14
8.2.10.0070.00317.72
8.2.00.0050.00517.66
8.1.340.0100.01017.77
8.1.330.0110.00721.89
8.1.320.0130.00716.36
8.1.310.0070.01118.58
8.1.300.0030.00518.45
8.1.290.0090.00030.84
8.1.280.0070.01425.92
8.1.270.0000.00823.76
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.88
8.1.230.0090.00317.45
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00817.23
8.1.190.0030.00617.23
8.1.180.0040.00418.10
8.1.170.0040.00418.77
8.1.160.0040.00418.86
8.1.150.0030.00618.64
8.1.140.0080.00317.32
8.1.130.0060.00317.36
8.1.120.0040.00717.38
8.1.110.0000.01017.36
8.1.100.0040.00917.40
8.1.90.0000.01117.50
8.1.80.0000.00917.39
8.1.70.0070.00717.46
8.1.60.0100.00017.43
8.1.50.0060.00617.46
8.1.40.0060.00617.64
8.1.30.0080.00317.52
8.1.20.0080.00417.56
8.1.10.0080.00417.50
8.1.00.0120.00017.55
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00818.41
8.0.270.0050.00516.78
8.0.260.0110.00416.70
8.0.250.0090.00516.86
8.0.240.0030.01016.81
8.0.230.0130.00016.82
8.0.220.0110.00016.77
8.0.210.0070.00416.78
8.0.200.0050.00516.85
8.0.190.0100.00016.80
8.0.180.0130.00316.83
8.0.170.0140.00016.89
8.0.160.0090.00616.82
8.0.150.0120.00316.81
8.0.140.0120.00416.73
8.0.130.0140.00216.74
8.0.120.0110.00316.75
8.0.110.0110.00416.91
8.0.100.0120.00416.73
8.0.90.0130.00216.86
8.0.80.0110.00416.83
8.0.70.0100.00516.83
8.0.60.0150.00016.84
8.0.50.0110.00416.82
8.0.30.0070.00716.74
8.0.20.0000.01416.96
8.0.10.0050.01017.00

preferences:
43.75 ms | 1121 KiB | 5 Q