3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LargeObject { protected $array; public function __construct() { $this->array = array_fill(0, 1000, 17); } public function getItemProcessor(): Closure { // Try with and without 'static' here return function () { // do some processing unrelated to $this }; } } $start = microtime(true); $processors = []; for ($i = 0; $i < 1000; $i++) { $lo = new LargeObject(); $processors[] = $lo->getItemProcessor(); } $memory = memory_get_usage() >> 20; $time = (microtime(true) - $start) * 1000; printf("This took %dms and %dMB of memory\n", $time, $memory);

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.0540.01532.72
8.4.110.0250.01034.69
8.4.100.0370.00834.03
8.4.90.0340.01033.95
8.4.80.0310.01433.78
8.4.70.0270.00933.79
8.4.60.0310.01033.92
8.4.50.0330.01033.96
8.4.40.0270.00733.72
8.4.30.0280.00633.77
8.4.20.0310.00633.70
8.4.10.0290.00833.78
8.3.240.0280.00932.69
8.3.230.0310.00732.77
8.3.220.0290.00832.57
8.3.210.0310.00632.61
8.3.200.0270.00632.59
8.3.190.0260.00632.60
8.3.180.0240.00832.51
8.3.170.0290.00532.60
8.3.160.0260.00832.47
8.3.150.0260.00832.58
8.3.140.0270.00832.63
8.3.130.0240.00632.55
8.3.120.0250.00632.67
8.3.110.0360.00833.55
8.3.100.0360.01033.29
8.3.90.0320.00632.96
8.3.80.0390.00633.02
8.3.70.0300.01132.71
8.3.60.0290.00832.64
8.3.50.0250.00932.89
8.3.40.0350.00933.72
8.3.30.0330.00733.67
8.3.20.0250.01233.79
8.3.10.0300.00833.96
8.3.00.0170.00834.30
8.2.290.0300.00732.65
8.2.280.0270.00932.66
8.2.270.0320.00832.57
8.2.260.0250.00732.68
8.2.250.0250.00832.59
8.2.240.0240.01032.75
8.2.230.0230.00633.16
8.2.220.0290.00932.77
8.2.210.0260.00632.80
8.2.200.0260.00932.87
8.2.190.0290.01232.81
8.2.180.0270.01232.78
8.2.170.0320.00834.05
8.2.160.0250.00734.19
8.2.150.0330.00933.93
8.2.140.0330.00833.90
8.2.130.0300.00633.97
8.2.120.0240.01133.92
8.2.110.0320.00534.01
8.2.100.0280.00733.96
8.2.90.0280.00834.06
8.2.80.0290.00833.94
8.2.70.0280.00533.89
8.2.60.0230.00833.96
8.2.50.0270.00934.14
8.2.40.0260.00834.10
8.2.30.0260.00733.91
8.2.20.0240.00833.86
8.2.10.0220.00833.94
8.2.00.0250.00933.82
8.1.330.0330.00947.79
8.1.320.0380.00947.84
8.1.310.0330.00747.91
8.1.300.0300.01047.85
8.1.290.0360.00948.11
8.1.280.0360.01048.88
8.1.270.0330.01043.98
8.1.260.0310.00943.97
8.1.250.0330.00843.66
8.1.240.0310.00743.86
8.1.230.0330.00843.95
8.1.220.0370.00943.89
8.1.210.0330.00943.81
8.1.200.0260.01244.05
8.1.190.0290.00843.78
8.1.180.0300.00943.86
8.1.170.0300.00943.92
8.1.160.0260.00843.84
8.1.150.0290.01044.06
8.1.140.0270.00943.70
8.1.130.0280.00843.64
8.1.120.0250.00943.72
8.1.110.0260.00743.69
8.1.100.0230.00943.75
8.1.90.0250.00943.66
8.1.80.0210.00943.83
8.1.70.0260.00843.78
8.1.60.0260.00843.78
8.1.50.0240.00843.72
8.1.40.0260.00843.79
8.1.30.0260.00943.79
8.1.20.0250.00843.83
8.1.10.0280.01149.48
8.1.00.0250.00949.45
8.0.300.0310.01048.75
8.0.290.0300.00948.75
8.0.280.0330.00848.97
8.0.270.0250.00848.60
8.0.260.0230.01048.59
8.0.250.0290.01048.71
8.0.240.0280.00848.60
8.0.230.0260.00848.79
8.0.220.0250.01048.64
8.0.210.0270.00948.53
8.0.200.0290.01048.54
8.0.190.0270.01148.62
8.0.180.0290.00948.72
8.0.170.0260.01048.81
8.0.160.0280.00948.76
8.0.150.0270.01048.60
8.0.140.0270.01048.56
8.0.130.0260.00948.67
8.0.120.0260.01148.72
8.0.110.0260.01048.69
8.0.100.0270.00948.73
8.0.90.0300.01048.59
8.0.80.0290.00948.64
8.0.70.0260.00948.61
8.0.60.0260.00948.73
8.0.50.0250.01048.68
8.0.30.0220.01248.72
8.0.20.0250.00848.72
8.0.10.0270.00848.82
7.4.330.0260.01046.67
7.4.320.0270.01048.51
7.4.300.0230.01048.37
7.4.290.0250.00848.37
7.4.280.0280.00948.46
7.4.270.0250.01048.36
7.4.260.0270.01048.48
7.4.250.0250.01148.39
7.4.240.0250.00948.40
7.4.230.0280.00948.48
7.4.220.0240.00948.33
7.4.210.0260.00848.37
7.4.200.0270.00948.34
7.4.190.0290.00848.37
7.4.180.0270.00948.34
7.4.160.0280.00948.45
7.4.150.0240.00948.41
7.4.140.0240.00948.35
7.4.130.0260.00848.37
7.4.120.0240.00948.44
7.4.110.0230.00948.37
7.4.100.0260.00948.37
7.4.90.0260.00948.36
7.4.80.0260.00948.34
7.4.70.0260.01048.28
7.4.60.0270.00848.26
7.4.50.0240.01048.12
7.4.40.0240.00848.12
7.4.30.0240.01048.18
7.4.20.0260.01048.07
7.4.10.0270.00948.17
7.4.00.0280.00848.26

preferences:
34.15 ms | 403 KiB | 5 Q