3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($a = 0; $a < 5; $a++) { $start = microtime(true); for ($i = 0; $i < 10000; $i++) { $args = ['a', 'b']; foreach ($args as $arg) { $arg = (string)$arg; } } echo round(microtime(true) - $start, 5) . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 10000; $i++) { $args = ['a', 'b']; while (count($args)) { $arg = (string)array_shift($args); } } echo round(microtime(true) - $start, 5) . PHP_EOL; }

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)
7.4.10.0110.02815.07
7.4.00.0070.02815.07
7.3.130.0070.03115.07
7.3.120.0100.02814.91
7.3.110.0110.01914.88
7.3.100.0080.01915.07
7.3.90.0100.01914.82
7.3.80.0090.01814.75
7.3.70.0100.01814.85
7.3.60.0070.02214.81
7.3.50.0100.01815.04
7.3.40.0090.01914.90
7.3.30.0070.02014.96
7.3.20.0070.02016.51
7.3.10.0070.02016.71
7.3.00.0030.02416.68
7.2.260.0100.03015.07
7.2.250.0100.02915.15
7.2.240.0080.02815.01
7.2.230.0080.02415.15
7.2.220.0050.02315.05
7.2.210.0020.02915.17
7.2.200.0080.02415.02
7.2.190.0110.01915.13
7.2.180.0080.02415.07
7.2.170.0070.02315.18
7.2.160.0030.02615.13
7.2.150.0030.02716.72
7.2.140.0100.02017.02
7.2.130.0050.02317.00
7.2.120.0050.02417.03
7.2.110.0050.02216.95
7.2.100.0000.02717.00
7.2.90.0050.02416.96
7.2.80.0030.02917.05
7.2.70.0020.02617.02
7.2.60.0070.02217.04
7.2.50.0080.02216.87
7.2.40.0080.02016.79
7.2.30.0070.02316.88
7.2.20.0060.02316.91
7.2.10.0100.02117.03
7.2.00.0070.02317.76
7.1.330.0050.04215.88
7.1.320.0100.04115.80
7.1.310.0050.04115.90
7.1.300.0020.04115.74
7.1.290.0080.03415.80
7.1.280.0070.03515.80
7.1.270.0030.04215.66
7.1.260.0080.03715.84
7.1.250.0100.03815.60
7.1.240.0060.03915.77
7.1.230.0030.04115.70
7.1.220.0100.03815.77
7.1.210.0130.03515.90
7.1.200.0030.05115.86
7.1.190.0070.04215.88
7.1.180.0070.04415.97
7.1.170.0030.04315.79
7.1.160.0130.03315.77
7.1.150.0090.03815.74
7.1.140.0030.04315.80
7.1.130.0000.05216.02
7.1.120.0030.04415.89
7.1.110.0030.04115.59
7.1.100.0000.04515.76
7.1.90.0070.03815.88
7.1.80.0060.03815.79
7.1.70.0060.03016.49
7.1.60.0080.03117.54
7.1.50.0080.04216.43
7.1.40.0030.04115.82
7.1.30.0000.04415.68
7.1.20.0030.04115.83
7.1.10.0030.04315.76
7.1.00.0070.06719.16
7.0.330.0030.04015.43
7.0.320.0000.04715.24
7.0.310.0000.04815.45
7.0.300.0030.04315.46
7.0.290.0030.04615.38
7.0.280.0000.05015.47
7.0.270.0030.04715.55
7.0.260.0100.03915.41
7.0.250.0000.04215.66
7.0.240.0060.04215.30
7.0.230.0030.05015.41
7.0.220.0000.04215.40
7.0.210.0070.04015.37
7.0.200.0130.03916.13
7.0.190.0030.04415.37
7.0.180.0060.03815.59
7.0.170.0030.04315.48
7.0.160.0030.04715.30
7.0.150.0100.04015.36
7.0.140.0030.06918.71
7.0.130.0070.04315.33
7.0.120.0070.04315.52
7.0.110.0030.04615.59
7.0.100.0100.03915.58
7.0.90.0070.04315.48
7.0.80.0030.04915.17
7.0.70.0030.05215.38
7.0.60.0080.06617.59
7.0.50.0050.04616.68
7.0.40.0030.05717.56
7.0.30.0180.05117.55
7.0.20.0120.04917.53
7.0.10.0150.07017.53
7.0.00.0080.06217.69
5.6.400.0070.09615.07
5.6.390.0070.08815.07
5.6.380.0070.09315.07
5.6.370.0030.10615.07
5.6.360.0100.09115.07
5.6.350.0030.09515.07
5.6.340.0070.09015.07
5.6.330.0030.11115.07
5.6.320.0070.09315.07
5.6.310.0100.08915.07
5.6.300.0070.09515.07
5.6.290.0100.08915.07
5.6.280.0050.13017.96
5.6.270.0070.10215.07
5.6.260.0030.09315.07
5.6.250.0030.09515.07
5.6.240.0070.09115.07
5.6.230.0070.09415.07
5.6.220.0070.09215.07
5.6.210.0080.08517.84
5.6.200.0070.11016.62
5.6.190.0080.08317.83
5.6.180.0150.10617.84
5.6.170.0120.09717.78
5.6.160.0050.09017.77
5.6.150.0080.10516.59
5.6.140.0070.10016.62
5.6.130.0130.11716.62
5.6.120.0020.09518.01
5.6.110.0030.08818.10
5.6.100.0080.11517.98
5.6.90.0100.11318.01
5.6.80.0020.11317.73
5.6.70.2220.09117.74
5.6.60.0070.09315.07
5.6.50.0070.09115.07
5.6.40.0030.09715.07
5.6.30.0030.09315.07
5.6.20.0030.09315.07
5.6.10.0030.09415.07
5.6.00.0100.08715.07
5.5.380.0070.10015.07
5.5.370.0100.08815.07
5.5.360.0070.09915.07
5.5.350.0050.12017.75
5.5.340.0070.09916.55
5.5.330.0070.12317.71
5.5.320.0200.11717.69
5.5.310.0130.10017.69
5.5.300.0020.10916.53
5.5.290.0120.11416.54
5.5.280.0030.09117.93
5.5.270.0050.09317.97
5.5.260.0120.14317.96
5.5.250.0100.10317.88
5.5.240.0030.09817.71
5.5.230.0030.09615.07
5.5.220.0030.09615.07
5.5.210.0070.11115.07
5.5.200.0100.09115.07
5.5.190.0030.09615.07
5.5.180.0030.09915.07
5.5.170.0030.10715.07
5.5.160.0070.10015.07
5.5.150.0030.12315.07
5.5.140.0100.08915.07
5.5.130.0070.09115.07
5.5.120.0070.09915.07
5.5.110.0100.09215.07
5.5.100.0100.09015.07
5.5.90.0030.09315.07
5.5.80.0030.10615.07
5.5.70.0060.09115.07
5.5.60.0030.09415.07
5.5.50.0100.08515.07
5.5.40.0100.08915.07
5.5.30.0030.09815.07
5.5.20.0070.10115.07
5.5.10.0030.09815.07
5.5.00.0100.08915.07
5.4.450.0220.11217.29
5.4.440.0120.09117.26
5.4.430.0120.09817.26
5.4.420.0220.10017.28
5.4.410.0100.10917.26
5.4.400.0350.10017.26
5.4.390.0120.10017.26
5.4.380.0280.11116.94
5.4.370.0150.13316.90
5.4.360.0250.11516.85
5.4.350.0200.11316.77
5.4.340.0180.12016.79
5.4.330.0070.09515.07
5.4.320.0060.09413.77
5.4.310.0050.10513.77
5.4.300.0050.10113.77
5.4.290.0060.09013.77
5.4.280.0040.09813.71
5.4.270.0060.09113.71
5.4.260.0050.09313.71
5.4.250.0020.09813.71
5.4.240.0030.10213.71
5.4.230.0060.10713.71
5.4.220.0050.10113.71
5.4.210.0050.09513.71
5.4.200.0070.11213.71
5.4.190.0040.11113.71
5.4.180.0050.10113.71
5.4.170.0070.09713.71
5.4.160.0070.09413.71
5.4.150.0090.09913.71
5.4.140.0050.09513.55
5.4.130.0050.09913.55
5.4.120.0020.09313.52
5.4.110.0040.09613.52
5.4.100.0010.10513.52
5.4.90.0050.10013.52
5.4.80.0050.09713.52
5.4.70.0050.09413.52
5.4.60.0040.10013.52
5.4.50.0060.10013.52
5.4.40.0070.09113.51
5.4.30.0080.10013.51
5.4.20.0060.09313.51
5.4.10.0030.10113.51
5.4.00.0030.10213.26
5.3.290.0060.04112.80
5.3.280.0050.04212.71
5.3.270.0080.03712.72
5.3.260.0070.03812.72
5.3.250.0070.03712.72
5.3.240.0060.03712.72
5.3.230.0080.04112.71
5.3.220.0070.03812.68
5.3.210.0060.03912.68
5.3.200.0080.04912.68
5.3.190.0040.04112.68
5.3.180.0080.03612.67
5.3.170.0110.03212.67
5.3.160.0120.03012.67
5.3.150.0060.03612.68
5.3.140.0040.03812.66
5.3.130.0090.03512.66
5.3.120.0060.03812.66
5.3.110.0100.03512.66
5.3.100.0060.03612.12
5.3.90.0090.03512.09
5.3.80.0050.03712.07
5.3.70.0070.03612.07
5.3.60.0070.03712.06
5.3.50.0100.03212.00
5.3.40.0050.03812.00
5.3.30.0090.03311.95
5.3.20.0090.03411.73
5.3.10.0060.03311.70
5.3.00.0060.04311.69
5.2.170.0040.0319.18
5.2.160.0050.0289.18
5.2.150.0030.0329.19
5.2.140.0050.0299.18
5.2.130.0050.0299.14
5.2.120.0040.0319.14
5.2.110.0040.0299.15
5.2.100.0060.0289.14
5.2.90.0040.0299.14
5.2.80.0050.0309.14
5.2.70.0070.0279.14
5.2.60.0100.0249.09
5.2.50.0060.0299.06
5.2.40.0030.0309.04
5.2.30.0050.0309.01
5.2.20.0020.0319.01
5.2.10.0050.0308.93
5.2.00.0040.0318.79
5.1.60.0060.0228.07
5.1.50.0040.0298.07
5.1.40.0050.0248.05
5.1.30.0020.0288.39
5.1.20.0040.0278.42
5.1.10.0020.0278.15
5.1.00.0010.0288.14
5.0.50.0070.0176.63
5.0.40.0060.0166.49
5.0.30.0050.0396.29
5.0.20.0080.0166.26
5.0.10.0040.0196.25
5.0.00.0030.0306.24
4.4.90.0010.0184.78
4.4.80.0020.0164.75
4.4.70.0010.0174.75
4.4.60.0030.0214.75
4.4.50.0030.0154.77
4.4.40.0030.0244.71
4.4.30.0040.0144.76
4.4.20.0020.0164.85
4.4.10.0030.0154.85
4.4.00.0040.0234.76
4.3.110.0010.0174.66
4.3.100.0030.0144.66
4.3.90.0030.0144.63
4.3.80.0020.0254.58
4.3.70.0040.0134.63
4.3.60.0040.0134.63
4.3.50.0040.0144.63
4.3.40.0040.0264.54
4.3.30.0000.0193.29
4.3.20.0030.0153.27
4.3.10.0020.0203.23
4.3.00.0170.02019.45

preferences:
32.81 ms | 401 KiB | 5 Q