3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* A tasks job is to count from 0 to $limit */ class Task { public function __construct($limit) { $this->limit = ($limit + 1) * 100; } public function doWork($async) { if ($async) { /* do a little work and allow another task to continue */ $this->position++; } else { /* do all the work */ for (; $this->position < $this->limit; $this->position++); } } public function hasWork() { return $this->position <= $this->limit; } public function getPosition() { return $this->position; } private $position = 0; private $limit = 0; } /* helper for detecting completion */ function finished($tasks) { foreach ($tasks as $task) { if ($task->hasWork()) return false; } return true; } /* helper for printing positions */ function positions($tasks, $numeric = false) { $positions = array(); foreach ($tasks as $task) { $positions[] = $numeric || $task->hasWork() ? $task->getPosition() : "-"; } return $positions; } /* create three tasks */ $tasks = array( new Task(0), new Task(1), new Task(2) ); /* execute tasks asynchronously */ while (!finished($tasks)) { foreach ($tasks as $task) { if ($task->hasWork()) { $task->doWork(true); } vprintf( "% 4s % 4s % 4s\n", positions($tasks)); } } printf("------------------\n"); $tasks = array( new Task(0), new Task(1), new Task(2) ); /* execute tasks synchronously */ foreach ($tasks as $task) { if ($task->hasWork()) { $task->doWork(false); } vprintf( "% 4s % 4s % 4s\n", positions($tasks)); } ?>

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.3.60.0100.00718.56
8.3.50.0100.01522.01
8.3.40.0110.00718.96
8.3.30.0130.00319.21
8.3.20.0050.00520.21
8.3.10.0090.00020.69
8.3.00.0060.00317.79
8.2.180.0140.00718.54
8.2.170.0150.00322.96
8.2.160.0130.00320.43
8.2.150.0060.00325.66
8.2.140.0030.00624.66
8.2.130.0090.00026.16
8.2.120.0060.00322.11
8.2.110.0030.00722.18
8.2.100.0100.00317.85
8.2.90.0070.00319.21
8.2.80.0060.00317.97
8.2.70.0000.00917.50
8.2.60.0080.00317.93
8.2.50.0000.01018.07
8.2.40.0060.00318.22
8.2.30.0070.00319.50
8.2.20.0000.00817.75
8.2.10.0000.00918.25
8.2.00.0030.00617.82
8.1.280.0140.01425.92
8.1.270.0000.00922.17
8.1.260.0030.00628.09
8.1.250.0060.00328.09
8.1.240.0080.00323.75
8.1.230.0050.00921.10
8.1.220.0050.00517.91
8.1.210.0000.00918.77
8.1.200.0060.00617.35
8.1.190.0090.00317.35
8.1.180.0030.00618.10
8.1.170.0060.00318.59
8.1.160.0040.00422.13
8.1.150.0090.00018.95
8.1.140.0030.00617.52
8.1.130.0080.00017.89
8.1.120.0040.00417.55
8.1.110.0060.00317.55
8.1.100.0040.00417.48
8.1.90.0040.00417.54
8.1.80.0040.00417.45
8.1.70.0000.00817.50
8.1.60.0060.00317.64
8.1.50.0030.00617.55
8.1.40.0030.00617.55
8.1.30.0000.00917.71
8.1.20.0060.00317.61
8.1.10.0030.00717.66
8.1.00.0050.00517.59
8.0.300.0030.00620.26
8.0.290.0030.00516.75
8.0.280.0000.00818.43
8.0.270.0000.00817.33
8.0.260.0040.00417.23
8.0.250.0050.00317.03
8.0.240.0000.00817.01
8.0.230.0000.00816.93
8.0.220.0080.00016.84
8.0.210.0000.00916.91
8.0.200.0040.00416.98
8.0.190.0000.00917.05
8.0.180.0030.00517.00
8.0.170.0030.00617.02
8.0.160.0060.00317.01
8.0.150.0040.00416.98
8.0.140.0030.00616.90
8.0.130.0040.00413.38
8.0.120.0040.00416.91
8.0.110.0030.00616.99
8.0.100.0040.00416.79
8.0.90.0030.00616.86
8.0.80.0030.01516.97
8.0.70.0030.00616.78
8.0.60.0060.00317.00
8.0.50.0060.00316.82
8.0.30.0220.01417.31
8.0.20.0120.01317.40
8.0.10.0040.00416.95
8.0.00.0170.01216.97
7.4.330.0070.00015.05
7.4.320.0030.00616.56
7.4.300.0050.00316.57
7.4.290.0030.00616.66
7.4.280.0030.00616.57
7.4.270.0030.00516.56
7.4.260.0000.01116.45
7.4.250.0030.00716.51
7.4.240.0010.00716.58
7.4.230.0080.00016.71
7.4.220.0100.01316.74
7.4.210.0030.01416.52
7.4.200.0040.00416.40
7.4.160.0180.01516.75
7.4.150.0130.01617.40
7.4.140.0160.00917.86
7.4.130.0110.01416.47
7.4.120.0170.01216.60
7.4.110.0170.00916.55
7.4.100.0140.01116.41
7.4.90.0210.00616.68
7.4.80.0100.01716.55
7.4.70.0040.01616.66
7.4.60.0090.01416.55
7.4.50.0070.00316.47
7.4.40.0150.01216.40
7.4.30.0080.01216.44
7.4.00.0030.01614.96
7.3.330.0070.00013.47
7.3.320.0030.00513.32
7.3.310.0030.00516.22
7.3.300.0060.00316.41
7.3.290.0100.00716.37
7.3.280.0060.01516.37
7.3.270.0140.01117.40
7.3.260.0110.01516.70
7.3.250.0190.01316.48
7.3.240.0160.01316.63
7.3.230.0170.00716.39
7.3.210.0230.00816.54
7.3.200.0180.01319.39
7.3.190.0120.01216.57
7.3.180.0080.01616.45
7.3.170.0090.01816.56
7.3.160.0080.01616.35
7.3.120.0070.01314.91
7.3.110.0100.01014.60
7.3.100.0080.00814.92
7.3.90.0110.00714.91
7.3.80.0110.00714.86
7.3.70.0040.01414.57
7.3.60.0100.00314.99
7.3.50.0060.00915.05
7.3.40.0000.01814.96
7.3.30.0070.01015.02
7.3.20.0100.00716.49
7.3.10.0100.00316.70
7.3.00.0040.01816.47
7.2.330.0190.00716.77
7.2.320.0150.00916.41
7.2.310.0090.01716.55
7.2.300.0170.00716.80
7.2.290.0110.01116.82
7.2.240.0100.01015.32
7.2.230.0100.01014.99
7.2.220.0100.01015.29
7.2.210.0100.01315.43
7.2.200.0150.00614.89
7.2.190.0060.01214.73
7.2.180.0070.00714.98
7.2.170.0080.00814.88
7.2.160.0080.01114.85
7.2.150.0080.00516.77
7.2.140.0070.01316.74
7.2.130.0060.01616.70
7.2.120.0100.01317.11
7.2.110.0120.00916.88
7.2.100.0030.01316.96
7.2.90.0090.00316.98
7.2.80.0100.01017.02
7.2.70.0070.01016.79
7.2.60.0080.00816.78
7.2.50.0100.00717.02
7.2.40.0060.00916.91
7.2.30.0120.00916.97
7.2.20.0120.00616.98
7.2.10.0100.00316.96
7.2.00.0050.01118.16
7.1.330.0030.01715.74
7.1.320.0070.01116.00
7.1.310.0030.01715.77
7.1.300.0110.00615.79
7.1.290.0030.01515.84
7.1.280.0060.00615.84
7.1.270.0060.00915.86
7.1.260.0120.00915.77
7.1.250.0090.01315.54
7.1.200.0030.01315.80
7.1.100.0700.00816.42
7.1.70.0070.00316.92
7.1.60.0100.01719.32
7.1.50.0090.00916.97
7.1.00.0030.08022.44
7.0.200.0090.00316.81
7.0.140.0100.07322.15
7.0.60.0130.03719.97
7.0.50.0070.08318.01
7.0.40.0100.06020.30
7.0.30.0230.06720.16
7.0.20.0200.04320.09
7.0.10.0070.04020.33
7.0.00.0000.06720.25
5.6.280.0070.07020.80
5.6.210.0030.08320.57
5.6.200.0030.07318.18
5.6.190.0100.04320.47
5.6.180.0430.05720.47
5.6.170.0400.07720.54
5.6.160.0200.07320.54
5.6.150.0130.08718.14
5.6.140.0100.08318.21
5.6.130.0230.07018.20
5.6.120.0070.04320.95
5.6.110.0070.08720.98
5.6.100.0030.04321.01
5.6.90.0170.03021.02
5.6.80.0070.04020.46
5.5.350.0200.07020.54
5.5.340.0070.08317.99
5.5.330.0030.05020.34
5.5.320.0330.07320.24
5.5.310.0170.09020.32
5.5.300.0070.08717.95
5.5.290.0070.06018.06
5.5.280.0100.08020.82
5.5.270.0130.06020.66
5.5.260.0100.09020.70
5.5.250.0070.08720.57
5.5.240.0170.07020.06
5.4.450.0230.06019.36
5.4.440.0100.07719.61
5.4.430.0200.06319.48
5.4.420.0200.06019.28
5.4.410.0170.06719.47
5.4.400.0200.05719.27
5.4.390.0200.07019.28
5.4.380.0300.05718.57
5.4.370.0330.06718.73
5.4.360.0670.05318.49
5.4.350.0600.07318.75
5.4.340.0400.07718.63
5.4.320.0060.04412.52
5.4.310.0070.05012.52
5.4.300.0130.04512.53
5.4.290.0070.04412.52
5.4.280.0110.03612.41
5.4.270.0110.04512.41
5.4.260.0100.04012.41
5.4.250.0060.04812.41
5.4.240.0110.03712.41
5.4.230.0060.04512.41
5.4.220.0050.04412.41
5.4.210.0090.04812.41
5.4.200.0120.04012.41
5.4.190.0070.04812.40
5.4.180.0080.04112.40
5.4.170.0120.03812.41
5.4.160.0110.03912.41
5.4.150.0120.03812.40
5.4.140.0060.04312.09
5.4.130.0070.04012.07
5.4.120.0070.04512.03
5.4.110.0110.03812.02
5.4.100.0100.03812.02
5.4.90.0060.04212.03
5.4.80.0060.05012.03
5.4.70.0120.04012.02
5.4.60.0080.03912.02
5.4.50.0090.04812.03
5.4.40.0050.04912.02
5.4.30.0110.04212.01
5.4.20.0100.04412.01
5.4.10.0080.04212.01
5.4.00.0100.04311.49
5.3.290.0060.05212.80
5.3.280.0070.05312.71
5.3.270.0090.04512.72
5.3.260.0090.04212.72
5.3.250.0090.05012.72
5.3.240.0100.04712.71
5.3.230.0090.04712.71
5.3.220.0100.04812.68
5.3.210.0090.04912.68
5.3.200.0100.05012.68
5.3.190.0110.04612.68
5.3.180.0150.04012.67
5.3.170.0080.04312.67
5.3.160.0090.04412.67
5.3.150.0110.04612.67
5.3.140.0060.05112.66
5.3.130.0090.04312.66
5.3.120.0100.04212.66
5.3.110.0080.04612.66
5.3.100.0100.04112.14
5.3.90.0100.04412.12
5.3.80.0090.04412.11
5.3.70.0110.04212.11
5.3.60.0080.04512.10
5.3.50.0070.04512.05
5.3.40.0120.04212.04
5.3.30.0060.04712.00
5.3.20.0100.04111.79
5.3.10.0110.04011.75
5.3.00.0060.05411.74
5.2.170.0080.0429.25
5.2.160.0060.0399.25
5.2.150.0050.0409.24
5.2.140.0110.0409.24
5.2.130.0100.0339.20
5.2.120.0050.0409.20
5.2.110.0090.0399.21
5.2.100.0080.0369.20
5.2.90.0090.0349.20
5.2.80.0080.0469.20
5.2.70.0070.0399.20
5.2.60.0100.0379.16
5.2.50.0060.0399.12
5.2.40.0050.0379.10
5.2.30.0030.0399.07
5.2.20.0110.0319.05
5.2.10.0090.0398.96
5.2.00.0050.0398.83
5.1.60.0080.0368.11
5.1.50.0100.0338.11
5.1.40.0070.0428.09
5.1.30.0080.0378.44
5.1.20.0090.0358.46
5.1.10.0070.0328.19
5.1.00.0070.0338.19
5.0.50.0060.0296.67
5.0.40.0030.0306.53
5.0.30.0060.0436.34
5.0.20.0020.0346.30
5.0.10.0040.0316.29
5.0.00.0080.0466.28
4.4.90.0040.0214.78
4.4.80.0040.0184.75
4.4.70.0040.0144.76
4.4.60.0030.0154.76
4.4.50.0030.0154.77
4.4.40.0010.0264.71
4.4.30.0030.0164.75
4.4.20.0040.0144.84
4.4.10.0050.0134.85
4.4.00.0020.0254.76
4.3.110.0020.0164.67
4.3.100.0030.0144.67
4.3.90.0030.0144.63
4.3.80.0030.0244.58
4.3.70.0030.0144.63
4.3.60.0040.0164.62
4.3.50.0000.0184.63
4.3.40.0020.0244.54
4.3.30.0030.0233.30
4.3.20.0030.0223.28
4.3.10.0000.0173.23
4.3.00.0030.0207.41

preferences:
62.44 ms | 401 KiB | 5 Q