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() { $this->position++; } public function hasWork() { return $this->position <= $this->limit; } public function getPosition() { return $this->position; } private $position = 0; private $limit = 0; } /* create three tasks */ $tasks[] = new Task(0); $tasks[] = new Task(1); $tasks[] = new Task(3); /* do some work */ function work($tasks) { foreach ($tasks as $task) if ($task->hasWork()) $task->doWork(); } /* detect more work to do */ function finished($tasks) { foreach ($tasks as $task) { if ($task->hasWork()) return false; } return true; } /* helper for printing positions */ function positions($tasks) { $positions = []; foreach ($tasks as $task) { $positions[] = $task->hasWork() ? $task->getPosition() : "-"; } return $positions; } /* execute tasks asynchronously */ while (!finished($tasks)) { vprintf( "% 4s % 4s % 4s\n", positions($tasks)); work($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.0120.00318.43
8.3.50.0130.00622.16
8.3.40.0090.00618.47
8.3.30.0060.01019.08
8.3.20.0000.00920.13
8.3.10.0060.00320.41
8.3.00.0060.00319.56
8.2.180.0130.00616.88
8.2.170.0060.00922.96
8.2.160.0110.00420.39
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00422.18
8.2.110.0030.00622.25
8.2.100.0100.00317.84
8.2.90.0030.00619.25
8.2.80.0060.00317.97
8.2.70.0030.00617.50
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0050.00318.28
8.2.30.0000.00719.53
8.2.20.0080.00017.68
8.2.10.0000.00918.14
8.2.00.0060.00317.81
8.1.280.0160.00625.92
8.1.270.0040.00423.83
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0160.00323.67
8.1.230.0040.00819.15
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0000.01017.11
8.1.190.0040.00417.35
8.1.180.0050.00518.10
8.1.170.0030.00618.60
8.1.160.0000.00921.95
8.1.150.0060.00318.91
8.1.140.0050.00317.52
8.1.130.0040.00417.78
8.1.120.0000.00817.46
8.1.110.0000.00817.49
8.1.100.0050.00217.33
8.1.90.0030.00617.51
8.1.80.0080.00017.38
8.1.70.0060.00317.42
8.1.60.0000.01017.64
8.1.50.0040.00417.43
8.1.40.0000.00917.41
8.1.30.0080.00017.66
8.1.20.0050.00317.68
8.1.10.0000.00917.58
8.1.00.0060.00317.51
8.0.300.0050.00318.77
8.0.290.0000.00916.75
8.0.280.0070.00018.48
8.0.270.0030.00517.20
8.0.260.0080.00017.28
8.0.250.0040.00416.96
8.0.240.0000.00716.96
8.0.230.0030.00516.89
8.0.220.0040.00416.79
8.0.210.0070.00016.91
8.0.200.0050.00216.97
8.0.190.0030.00617.02
8.0.180.0080.00016.92
8.0.170.0000.00916.90
8.0.160.0000.00816.92
8.0.150.0020.00516.80
8.0.140.0080.00016.83
8.0.130.0030.00313.34
8.0.120.0000.00816.79
8.0.110.0080.00016.96
8.0.100.0040.00516.77
8.0.90.0060.00316.94
8.0.80.0100.00716.79
8.0.70.0000.00816.85
8.0.60.0000.00816.98
8.0.50.0000.00816.71
8.0.30.0140.01017.09
8.0.20.0200.00517.40
8.0.10.0050.00216.91
8.0.00.0160.00716.79
7.4.330.0000.00515.00
7.4.320.0030.00316.54
7.4.300.0030.00316.63
7.4.290.0040.00416.59
7.4.280.0040.00416.66
7.4.270.0030.00516.63
7.4.260.0040.00416.57
7.4.250.0050.00316.58
7.4.240.0050.00316.54
7.4.230.0080.00016.55
7.4.220.0200.00016.55
7.4.210.0040.01116.49
7.4.200.0070.00016.62
7.4.160.0040.01816.56
7.4.150.0120.01217.40
7.4.140.0090.01117.86
7.4.130.0130.01116.66
7.4.120.0110.00916.55
7.4.110.0140.00516.44
7.4.100.0000.02116.52
7.4.90.0170.00716.61
7.4.80.0100.01016.57
7.4.70.0120.00916.65
7.4.60.0090.01016.59
7.4.50.0060.00316.45
7.4.40.0170.00016.48
7.4.30.0000.01916.74
7.4.10.0110.00815.13
7.4.00.0050.01215.13
7.3.330.0060.00013.13
7.3.320.0060.00013.28
7.3.310.0040.00416.21
7.3.300.0000.00716.33
7.3.290.0080.00816.27
7.3.280.0100.00816.26
7.3.270.0070.01317.40
7.3.260.0150.00916.39
7.3.250.0080.01116.46
7.3.240.0140.00716.57
7.3.230.0140.01116.42
7.3.210.0090.01616.25
7.3.200.0090.01319.39
7.3.190.0040.02016.48
7.3.180.0100.01016.44
7.3.170.0120.01616.50
7.3.160.0110.00916.61
7.3.130.0130.00614.48
7.3.120.0060.00614.85
7.3.110.0000.01814.76
7.3.100.0100.00614.87
7.3.90.0060.00914.80
7.3.80.0090.00614.80
7.3.70.0030.00914.60
7.3.60.0040.01514.68
7.3.50.0100.00614.77
7.3.40.0000.01514.94
7.3.30.0030.00614.79
7.3.20.0030.01416.75
7.3.10.0100.00816.24
7.3.00.0080.00716.65
7.2.330.0170.00616.93
7.2.320.0080.01216.83
7.2.310.0180.00416.50
7.2.300.0100.01016.82
7.2.290.0120.00816.62
7.2.260.0030.01415.03
7.2.250.0070.01015.18
7.2.240.0000.01914.77
7.2.230.0070.01415.14
7.2.220.0030.01415.29
7.2.210.0110.00415.13
7.2.200.0070.00715.20
7.2.190.0070.01014.95
7.2.180.0020.01014.98
7.2.170.0090.00915.18
7.2.160.0120.00314.98
7.2.150.0030.00917.11
7.2.140.0100.00716.71
7.2.130.0100.01116.73
7.2.120.0050.01216.94
7.2.110.0070.01216.90
7.2.100.0110.00416.76
7.2.90.0050.01116.82
7.2.80.0110.01116.81
7.2.70.0100.01216.96
7.2.60.0100.00816.92
7.2.50.0090.00916.79
7.2.40.0070.00716.94
7.2.30.0120.00516.80
7.2.20.0070.00716.91
7.2.10.0130.01016.82
7.2.00.0070.00817.79
7.1.330.0030.01315.86
7.1.320.0060.01415.33
7.1.310.0080.00615.99
7.1.300.0120.00615.68
7.1.290.0060.00915.71
7.1.280.0060.00915.75
7.1.270.0100.00615.67
7.1.260.0130.00315.64
7.1.250.0000.01315.74
7.1.240.0040.00815.41
7.1.230.0070.00715.45
7.1.220.0070.00715.82
7.1.210.0040.01115.75
7.1.200.0070.00915.63
7.1.190.0110.00015.48
7.1.180.0030.01215.69
7.1.170.0040.01215.56
7.1.160.0030.00615.73
7.1.150.0120.00015.60
7.1.140.0070.00715.85
7.1.130.0040.00815.57
7.1.120.0030.01415.43
7.1.110.0140.00015.84
7.1.100.0030.00816.86
7.1.90.0070.01015.80
7.1.80.0070.01015.81
7.1.70.0070.00516.46
7.1.60.0060.00617.48
7.1.50.0040.01416.20
7.1.40.0000.01015.34
7.1.30.0000.01515.63
7.1.20.0040.01115.66
7.1.10.0030.01015.88
7.1.00.0110.03718.85
7.0.330.0060.00915.39
7.0.320.0060.00615.07
7.0.310.0120.00315.19
7.0.300.0040.01115.44
7.0.290.0070.01115.41
7.0.280.0000.01315.38
7.0.270.0030.01015.41
7.0.260.0140.00015.43
7.0.250.0070.00715.46
7.0.240.0000.01515.46
7.0.230.0050.00515.36
7.0.220.0130.00315.54
7.0.210.0080.00615.23
7.0.200.0020.00916.02
7.0.190.0030.01215.16
7.0.180.0030.01315.48
7.0.170.0070.01015.54
7.0.160.0000.01015.50
7.0.150.0000.01415.39
7.0.140.0060.03818.69
7.0.130.0030.00915.28
7.0.120.0070.00715.44
7.0.110.0080.00415.41
7.0.100.0120.00315.30
7.0.90.0090.00915.47
7.0.80.0090.00915.12
7.0.70.0060.00915.55
7.0.60.0080.04317.64
7.0.50.0050.04516.74
7.0.40.0050.03216.81
7.0.30.0180.04116.83
7.0.20.0170.04516.76
7.0.10.0110.04316.77
7.0.00.0100.04616.79
5.6.400.0030.01014.37
5.6.390.0030.01314.44
5.6.380.0070.01014.57
5.6.370.0100.00314.67
5.6.360.0070.00714.50
5.6.350.0110.00614.23
5.6.340.0070.01314.39
5.6.330.0040.00814.33
5.6.320.0110.00614.61
5.6.310.0080.00414.58
5.6.300.0040.01214.46
5.6.290.0040.01714.54
5.6.280.0100.04217.98
5.6.270.0030.01314.48
5.6.260.0060.00914.62
5.6.250.0070.01014.25
5.6.240.0000.02014.54
5.6.230.0000.01614.17
5.6.220.0030.01714.43
5.6.210.0110.04517.40
5.6.200.0120.02416.26
5.6.190.0100.03717.58
5.6.180.0290.04017.48
5.6.170.0250.02817.53
5.6.160.0090.04717.67
5.6.150.0150.03916.36
5.6.140.0060.03116.47
5.6.130.0120.04716.32
5.6.120.0080.04617.80
5.6.110.0030.03017.78
5.6.100.0060.03517.61
5.6.90.0050.04817.66
5.6.80.0050.04517.29
5.6.70.0030.01314.14
5.6.60.0000.01814.30
5.6.50.0110.01114.52
5.6.40.0060.00614.18
5.6.30.0030.00914.23
5.6.20.0090.00914.25
5.6.10.0100.01014.46
5.6.00.0090.00914.41
5.5.380.0090.01214.13
5.5.370.0030.01314.48
5.5.360.0080.00814.30
5.5.350.0150.04017.34
5.5.340.0080.04316.04
5.5.330.0020.03417.45
5.5.320.0120.03817.43
5.5.310.0180.04517.30
5.5.300.0050.02816.09
5.5.290.0100.04616.31
5.5.280.0050.04317.65
5.5.270.0050.04917.67
5.5.260.0070.04017.63
5.5.250.0050.02817.49
5.5.240.0070.04517.40
5.5.230.0040.00714.23
5.5.220.0100.01014.50
5.5.210.0070.01114.27
5.5.200.0070.01014.38
5.5.190.0060.00914.37
5.5.180.0040.01414.36
5.5.170.0060.01214.17
5.5.160.0070.01014.38
5.5.150.0060.00614.52
5.5.140.0070.01114.27
5.5.130.0090.00914.16
5.5.120.0100.00614.34
5.5.110.0100.00714.57
5.5.100.0060.01214.15
5.5.90.0030.01314.41
5.5.80.0000.01514.01
5.5.70.0030.01014.29
5.5.60.0040.00814.32
5.5.50.0100.00714.40
5.5.40.0060.01314.39
5.5.30.0090.00914.14
5.5.20.0100.00313.96
5.5.10.0060.01314.49
5.5.00.0160.00314.44
5.4.450.0300.03615.22
5.4.440.0220.03515.40
5.4.430.0120.04615.37
5.4.420.0320.03015.53
5.4.410.0130.02715.32
5.4.400.0130.03215.03
5.4.390.0140.03215.07
5.4.380.0220.03314.87
5.4.370.0270.02815.10
5.4.360.0250.03615.02
5.4.350.0270.03214.95
5.4.340.0310.03714.88
5.4.330.0030.01311.29
5.4.320.0050.02711.76
5.4.310.0050.02311.83
5.4.300.0060.02311.81
5.4.290.0060.02511.90
5.4.280.0090.02011.80
5.4.270.0070.02411.74
5.4.260.0080.02511.81
5.4.250.0090.02011.82
5.4.240.0050.02411.76
5.4.230.0080.02711.83
5.4.220.0060.02711.90
5.4.210.0070.02311.88
5.4.200.0060.02611.74
5.4.190.0070.02111.73
5.4.180.0050.02411.89
5.4.170.0070.02311.88
5.4.160.0040.02811.81
5.4.150.0100.02111.80
5.4.140.0050.02511.76
5.4.130.0040.02311.73
5.4.120.0050.02611.63
5.4.110.0050.02411.73
5.4.100.0020.02811.43
5.4.90.0050.02411.51
5.4.80.0050.02411.61
5.4.70.0060.02611.70
5.4.60.0070.02711.65
5.4.50.0060.02311.62
5.4.40.0050.02111.55
5.4.30.0080.02111.67
5.4.20.0080.02311.65
5.4.10.0070.02311.44
5.4.00.0070.02511.37
5.3.290.0080.03912.80
5.3.280.0080.04212.71
5.3.270.0060.03812.72
5.3.260.0060.03812.72
5.3.250.0060.03612.72
5.3.240.0030.03912.72
5.3.230.0070.03712.71
5.3.220.0080.03612.68
5.3.210.0120.04512.68
5.3.200.0070.03612.68
5.3.190.0060.04112.68
5.3.180.0060.03712.68
5.3.170.0100.03612.67
5.3.160.0070.03912.68
5.3.150.0060.03912.67
5.3.140.0080.03612.66
5.3.130.0050.03912.66
5.3.120.0040.04012.66
5.3.110.0080.03612.66
5.3.100.0060.03712.13
5.3.90.0100.03712.12
5.3.80.0110.03512.11
5.3.70.0110.03712.11
5.3.60.0070.04212.09
5.3.50.0080.03312.04
5.3.40.0090.04112.04
5.3.30.0070.03712.00
5.3.20.0040.03711.78
5.3.10.0080.04011.75
5.3.00.0070.04011.73
5.2.170.0050.0309.23
5.2.160.0020.0319.23
5.2.150.0050.0349.23
5.2.140.0070.0309.23
5.2.130.0070.0349.19
5.2.120.0070.0329.19
5.2.110.0050.0319.20
5.2.100.0050.0299.20
5.2.90.0030.0329.20
5.2.80.0070.0289.19
5.2.70.0040.0319.20
5.2.60.0040.0329.15
5.2.50.0050.0299.12
5.2.40.0080.0309.10
5.2.30.0060.0319.07
5.2.20.0050.0349.05
5.2.10.0030.0338.96
5.2.00.0090.0318.83
5.1.60.0050.0248.12
5.1.50.0020.0268.11
5.1.40.0070.0248.09
5.1.30.0060.0288.43
5.1.20.0040.0298.46
5.1.10.0050.0288.19
5.1.00.0030.0348.18
5.0.50.0050.0206.67
5.0.40.0060.0176.52
5.0.30.0040.0346.34
5.0.20.0020.0246.30
5.0.10.0040.0206.28
5.0.00.0040.0326.27
4.4.90.0040.0144.78
4.4.80.0030.0174.76
4.4.70.0030.0154.75
4.4.60.0010.0174.76
4.4.50.0050.0174.77
4.4.40.0020.0254.71
4.4.30.0030.0174.76
4.4.20.0030.0174.84
4.4.10.0050.0154.85
4.4.00.0020.0294.76
4.3.110.0060.0174.67
4.3.100.0030.0144.66
4.3.90.0030.0144.64
4.3.80.0030.0244.58
4.3.70.0010.0164.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0040.0224.54
4.3.30.0020.0163.30
4.3.20.0030.0153.28
4.3.10.0020.0153.24
4.3.00.0000.0236.64

preferences:
39.86 ms | 401 KiB | 5 Q