3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = microtime(true); for($i=0; $i<100000; $i++) { $foo = "foo"; $bar = "bar"; $baz = "baz"; $array = compact('foo','bar','baz'); } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "With compact : $elapsed seconds\n"; $startTime = microtime(true); for($i=0; $i<100000; $i++) { $array = [ 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ]; } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "Without compact time : $elapsed seconds\n";

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.110.0240.02416.24
8.3.10.0130.02423.69
8.3.00.0130.02018.75
8.2.140.0090.00620.35
8.2.130.0100.01720.19
8.2.120.0080.00819.03
8.2.110.0090.03319.79
8.2.100.0080.00619.02
8.2.90.0040.01118.79
8.2.80.0070.02019.15
8.2.70.0040.01118.82
8.2.60.0090.00618.78
8.2.50.0060.00818.77
8.2.40.0080.00818.64
8.2.30.0060.00918.79
8.2.20.0010.01618.33
8.2.10.0030.01318.55
8.2.00.0050.01118.47
8.1.280.0190.02625.92
8.1.270.0030.01022.06
8.1.260.0030.01022.08
8.1.250.0040.01122.19
8.1.240.0040.01118.67
8.1.230.0110.00418.54
8.1.220.0140.00718.82
8.1.210.0040.01118.54
8.1.200.0060.00918.80
8.1.190.0040.01118.59
8.1.180.0030.01018.34
8.1.170.0040.01118.35
8.1.160.0090.00618.54
8.1.150.0050.01118.32
8.1.140.0080.00818.30
8.1.130.0070.01218.38
8.1.120.0080.00818.31
8.1.110.0030.01318.29
8.1.100.0030.01318.35
8.1.90.0050.01118.33
8.1.80.0050.01118.40
8.1.70.0040.01218.29
8.1.60.0030.01218.40
8.1.50.0040.01617.70
8.1.40.0040.01118.42
8.1.30.0040.01118.38
8.1.20.0050.01118.43
8.1.10.0050.01118.48
8.1.00.0050.01318.41
8.0.300.0000.01417.82
8.0.290.0080.00517.90
8.0.280.0070.00717.95
8.0.270.0050.01018.06
8.0.260.0020.01418.00
8.0.250.0000.01518.05
8.0.240.0080.01318.00
8.0.230.0060.01418.03
8.0.220.0020.01418.01
8.0.210.0030.01318.02
8.0.200.0060.01018.08
8.0.190.0060.01018.07
8.0.180.0030.01218.02
8.0.170.0020.01318.06
8.0.160.0050.01018.04
8.0.150.0040.01317.97
8.0.140.0040.01118.04
8.0.130.0050.01017.97
8.0.120.0050.01217.97
8.0.110.0030.01217.98
8.0.100.0050.01017.98
8.0.90.0030.01217.91
8.0.80.0060.01017.98
8.0.70.0070.01417.63
8.0.60.0060.01917.62
8.0.50.0050.01917.63
8.0.30.0070.01517.43
8.0.20.0090.01517.49
8.0.10.0050.02017.50
8.0.00.0070.02317.66
7.4.330.0120.02015.14
7.4.320.0100.01217.78
7.4.300.0090.01717.82
7.4.290.0080.01817.66
7.4.280.0160.00917.77
7.4.270.0090.01817.88
7.4.260.0170.01117.84
7.4.250.0130.01715.55
7.4.240.0180.01517.79
7.4.230.0160.01217.74
7.4.220.0170.01917.78
7.4.210.0180.01817.77
7.4.200.0150.02317.34
7.4.190.0170.02117.42
7.4.180.0160.01817.38
7.4.160.0080.01917.24
7.4.150.0100.02217.12
7.4.140.0100.01717.09
7.4.130.0110.02116.88
7.4.120.0120.02616.80
7.4.110.0130.02416.84
7.4.100.0130.02416.89
7.4.90.0110.02516.88
7.4.80.0150.02316.71
7.4.70.0140.02816.73
7.4.60.0130.02516.84
7.4.50.0150.02216.82
7.4.40.0130.02216.74
7.4.30.0130.02116.79
7.4.20.0120.02316.70
7.4.10.0140.02016.75
7.4.00.0130.02516.73
7.3.330.0050.01816.95
7.3.320.0110.01317.63
7.3.310.0150.00917.80
7.3.300.0070.01717.91
7.3.290.0130.01117.57
7.3.280.0120.01616.99
7.3.270.0100.01817.02
7.3.260.0110.01617.04
7.3.250.0130.02116.83
7.3.240.0120.02416.71
7.3.230.0140.02416.82
7.3.220.0120.02516.72
7.3.210.0110.02716.72
7.3.200.0160.02316.78
7.3.190.0140.02516.67
7.3.180.0140.02316.74
7.3.170.0130.02616.83
7.3.160.0100.02916.68
7.3.150.0120.02616.70
7.3.140.0110.02316.67
7.3.130.0080.02616.66
7.3.120.0090.02316.71
7.3.110.0140.02216.72
7.3.100.0100.02316.61
7.3.90.0130.02516.83
7.3.80.0120.02216.65
7.3.70.0130.02016.43
7.3.60.0110.02116.43
7.3.50.0120.02516.52
7.3.40.0120.02416.28
7.3.30.0090.02716.06
7.3.20.0530.02216.13
7.3.10.0330.02715.93
7.3.00.0610.02815.82
7.2.340.0200.03116.89
7.2.330.0130.03016.87
7.2.320.0170.02716.87
7.2.310.0170.02516.86
7.2.300.0190.02716.82
7.2.290.0130.02416.85
7.2.280.0100.03116.82
7.2.270.0130.02616.86
7.2.260.0150.02316.83
7.2.250.0130.02416.90
7.2.240.0150.03216.80
7.2.230.0150.02716.93
7.2.220.0140.02916.83
7.2.210.0120.02516.79
7.2.200.0110.03316.68
7.2.190.0160.02416.64
7.2.180.0130.02816.58
7.2.170.0140.03016.39
7.2.160.0140.02816.29
7.2.150.0490.02616.35
7.2.140.0170.03116.33
7.2.130.0370.02716.24
7.2.120.0330.02516.07
7.2.110.0310.02716.16
7.2.100.0740.02516.13
7.2.90.0670.02916.18
7.2.80.0800.02716.19
7.2.70.0690.02416.18
7.2.60.0590.02716.17
7.2.50.0470.02716.12
7.2.40.0620.02616.16
7.2.30.0610.03016.21
7.2.20.0550.02416.20
7.2.10.0560.02416.08
7.2.00.0500.02416.28
7.1.330.0150.03216.00
7.1.320.0230.03316.04
7.1.310.0130.03315.96
7.1.300.0110.03315.70
7.1.290.0190.02915.67
7.1.280.0160.03215.56
7.1.270.0640.03015.53
7.1.260.0220.03015.34
7.1.250.0360.03315.10
7.1.240.0560.03215.01
7.1.230.0400.03215.10
7.1.220.0740.02915.11
7.1.210.0740.02715.05
7.1.200.0660.03115.11
7.1.190.0340.03115.55
7.1.180.0570.03015.05
7.1.170.0600.03315.07
7.1.160.0550.03015.09
7.1.150.0620.02914.93
7.1.140.0500.03414.95
7.1.130.0590.03215.07
7.1.120.0460.03315.16
7.1.110.0610.03115.32
7.1.100.0550.02915.15
7.1.90.0380.02915.34
7.1.80.0470.03115.47
7.1.70.0390.03215.32
7.1.60.0340.03418.53
7.1.50.0340.03218.47
7.1.40.0290.03418.41
7.1.30.0320.03318.45
7.1.20.0360.03318.41
7.1.10.0370.03215.28
7.1.00.0330.03115.28
7.0.330.0370.03314.79
7.0.320.0650.03914.86
7.0.310.0730.03814.80
7.0.300.0640.03714.82
7.0.290.0590.03314.75
7.0.280.0600.03614.83
7.0.270.0530.03714.90
7.0.260.0370.03514.90
7.0.250.0480.03815.03
7.0.240.0490.03515.01
7.0.230.0360.03715.05
7.0.220.0430.03915.01
7.0.210.0280.03614.98
7.0.200.0400.04015.11
7.0.190.0360.03715.04
7.0.180.0320.03914.98
7.0.170.0450.03915.01
7.0.160.0360.03414.93
7.0.150.0310.03614.98
7.0.140.0310.03615.03
7.0.130.0320.03515.01
7.0.120.0300.03615.04
7.0.110.0270.03814.98
7.0.100.0290.03615.05
7.0.90.0280.03914.96
7.0.80.0230.03615.02
7.0.70.0270.04014.91
7.0.60.0230.03914.84
7.0.50.0230.03514.87
7.0.40.0280.04114.90
7.0.30.0250.03514.89
7.0.20.0270.04114.91
7.0.10.0270.03814.98
7.0.00.0280.03714.87
5.6.400.0140.09715.83
5.6.390.0130.08615.67
5.6.380.0140.09215.19
5.6.370.0150.08715.20
5.6.360.0150.09215.14
5.6.350.0150.09515.20
5.6.340.0150.09915.20
5.6.330.0130.08215.25
5.6.320.0150.09015.25
5.6.310.0150.08815.16
5.6.300.0160.10015.86
5.6.290.0150.10315.89
5.6.280.0160.09315.87
5.6.270.0180.09515.92
5.6.260.0140.09715.90
5.6.250.0140.10915.88
5.6.240.0150.10415.89
5.6.230.0140.10015.93
5.6.220.0170.10715.89
5.6.210.0140.11215.95
5.6.200.0170.09715.91
5.6.190.0130.10915.93
5.6.180.0150.10215.92
5.6.170.0130.10115.90
5.6.160.0150.10815.91
5.6.150.0140.10315.92
5.6.140.0160.10415.89
5.6.130.0140.10415.90
5.6.120.0160.09815.92
5.6.110.0110.10915.89
5.6.100.0130.10915.90
5.6.90.0160.09115.91
5.6.80.0160.10115.73
5.6.70.0130.10115.76
5.6.60.0140.09815.80
5.6.50.0140.10015.74
5.6.40.0130.10215.75
5.6.30.0140.09815.76
5.6.20.0160.10515.73
5.6.10.0150.09915.69
5.6.00.0150.09615.67
5.5.380.0140.10814.54
5.5.370.0140.10114.52
5.5.360.0140.10414.56
5.5.350.0150.10614.53
5.5.340.0130.10014.58
5.5.330.0140.09214.62
5.5.320.0130.10514.59
5.5.310.0150.10214.58
5.5.300.0160.10014.54
5.5.290.0140.09714.58
5.5.280.0150.10714.58
5.5.270.0130.10514.54
5.5.260.0150.10214.63
5.5.250.0140.10414.56
5.5.240.0140.10614.50
5.5.230.0160.10114.52
5.5.220.0120.09814.51
5.5.210.0120.10114.46
5.5.200.0120.09814.44
5.5.190.0140.11114.45
5.5.180.0140.09614.45
5.5.170.0150.09314.74
5.5.160.0130.09714.42
5.5.150.0160.09814.46
5.5.140.0160.10514.41
5.5.130.0130.10314.47
5.5.120.0150.11114.42
5.5.110.0140.10814.44
5.5.100.0120.10714.46
5.5.90.0130.09914.50
5.5.80.0140.10614.50
5.5.70.0150.10914.48
5.5.60.0160.09714.45
5.5.50.0140.09714.43
5.5.40.0130.10914.45
5.5.30.0130.10014.43
5.5.20.0130.09914.43
5.5.10.0150.09814.44
5.5.00.0140.10414.33

preferences:
15.07 ms | 403 KiB | 5 Q