3v4l.org

run code in 300+ PHP versions simultaneously
<?php // test one.. // start time $st = microtime(); function arr1(){ $arr1 = array(); $arr2 = array(); $arr3 = array(); $arr1['key1'] = 'val1'; $arr2['key1'] = 'val1'; $arr3['key1'] = 'val1'; return array($arr1, $arr2, $arr3); } $i = 1000; while($i--){ $poo = arr1(); } echo "Method 1: created 1000 arrays in " . (microtime() - $st) . " microseconds...\n"; // test two.. // start time $st = microtime(); function arr2(){ $arr1 = array(); $arr1['arr1']['key1'] = 'val1'; $arr1['arr2']['key1'] = 'val1'; $arr1['arr3']['key1'] = 'val1'; return array($arr1); } $i = 1000; while($i--){ $poo = arr2(); } echo "Method 2: created 1000 arrays in " . (microtime() - $st) . " microseconds...\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)
7.4.10.0090.00915.05
7.4.00.0030.01015.03
7.3.130.0130.00715.02
7.3.120.0100.00714.78
7.3.110.0090.00914.99
7.3.100.0020.01315.02
7.3.90.0050.01114.84
7.3.80.0080.00414.89
7.3.70.0050.01014.96
7.3.60.0020.01214.66
7.3.50.0050.01114.90
7.3.40.0100.00414.84
7.3.30.0040.01114.81
7.3.20.0080.00616.72
7.3.10.0020.01416.74
7.3.00.0070.00716.67
7.2.260.0040.01814.87
7.2.250.0070.01015.07
7.2.240.0060.01014.87
7.2.230.0050.01214.97
7.2.220.0060.01015.02
7.2.210.0050.01115.08
7.2.200.0070.01115.03
7.2.190.0050.01215.03
7.2.180.0020.01415.03
7.2.170.0000.01315.05
7.2.160.0050.01015.10
7.2.150.0040.00916.97
7.2.140.0030.01016.93
7.2.130.0050.01116.87
7.2.120.0070.00816.90
7.2.110.0060.00617.02
7.2.100.0080.00716.89
7.2.90.0070.00716.90
7.2.80.0090.00916.94
7.2.70.0050.01116.81
7.2.60.0050.01117.01
7.2.50.0020.01417.02
7.2.40.0100.00616.90
7.2.30.0040.01117.00
7.2.20.0060.01216.84
7.2.10.0060.01017.04
7.2.00.0030.01217.60
7.1.330.0070.00815.92
7.1.320.0060.00615.78
7.1.310.0020.01015.95
7.1.300.0070.00915.92
7.1.290.0040.01115.61
7.1.280.0050.01115.80
7.1.270.0050.00815.61
7.1.260.0050.00915.80
7.1.250.0040.00915.70
7.1.240.0000.01515.68
7.1.230.0080.00815.78
7.1.220.0070.00715.83
7.1.210.0090.00215.86
7.1.200.0030.01015.93
7.1.190.0100.00615.81
7.1.180.0060.00915.80
7.1.170.0080.00415.70
7.1.160.0000.01415.90
7.1.150.0030.01015.46
7.1.140.0100.00715.72
7.1.130.0050.00715.93
7.1.120.0100.00715.71
7.1.110.0030.01015.99
7.1.100.0070.00716.02
7.1.90.0080.00615.91
7.1.80.0000.01215.88
7.1.70.0040.01116.57
7.1.60.0080.01217.57
7.1.50.0050.00516.28
7.1.40.0030.01016.02
7.1.30.0030.01316.00
7.1.20.0000.01515.86
7.1.10.0070.00715.45
7.1.00.0100.03819.10
7.0.330.0000.01415.09
7.0.320.0100.00615.25
7.0.310.0040.01115.40
7.0.300.0060.00915.08
7.0.290.0110.00415.57
7.0.280.0070.00715.65
7.0.270.0060.01015.43
7.0.260.0080.00415.60
7.0.250.0030.01215.54
7.0.240.0000.01415.49
7.0.230.0060.01015.60
7.0.220.0040.01115.30
7.0.210.0090.00615.19
7.0.200.0070.00416.08
7.0.190.0060.00915.44
7.0.180.0030.01015.54
7.0.170.0070.01015.26
7.0.160.0000.01115.31
7.0.150.0030.01415.52
7.0.140.0090.00615.29
7.0.130.0000.00915.34
7.0.120.0000.01015.66
7.0.110.0000.01415.46
7.0.100.0000.00915.55
7.0.90.0110.00315.55
7.0.80.0030.01015.38
7.0.70.0000.01415.47
7.0.60.0100.04217.69
7.0.50.0030.02616.74
7.0.40.0070.03216.79
7.0.30.0300.02616.79
7.0.20.0120.02516.81
7.0.10.0030.04716.86
7.0.00.0070.04416.87
5.6.400.0060.01214.35
5.6.390.0130.00314.69
5.6.380.0030.01414.34
5.6.370.0080.01114.48
5.6.360.0000.01514.36
5.6.350.0000.01714.38
5.6.340.0030.01214.10
5.6.330.0100.00714.14
5.6.320.0030.01014.03
5.6.310.0090.00314.49
5.6.300.0060.00714.33
5.6.290.0120.00814.45
5.6.280.0030.04517.89
5.6.270.0070.01014.36
5.6.260.0130.00314.58
5.6.250.0060.01214.56
5.6.240.0040.01414.38
5.6.230.0100.00714.45
5.6.220.0070.01014.38
5.6.210.0060.02617.55
5.6.200.0080.04816.22
5.6.190.0070.03117.44
5.6.180.0080.02817.49
5.6.170.0170.04317.38
5.6.160.0090.03417.50
5.6.150.0050.04716.43
5.6.140.0020.03116.25
5.6.130.0050.04916.29
5.6.120.0040.03117.76
5.6.110.0080.04817.73
5.6.100.0090.04617.70
5.6.90.0070.04617.75
5.6.80.0030.05017.43
5.6.70.0040.01114.67
5.6.60.0030.01214.29
5.6.50.0040.01414.47
5.6.40.0060.01014.43
5.6.30.0040.01114.40
5.6.20.0100.00714.36
5.6.10.0060.00914.44
5.6.00.0040.01214.53
5.5.380.0000.01814.28
5.5.370.0040.01114.40
5.5.360.0070.00714.27
5.5.350.1690.02017.48
5.5.340.0100.04516.05
5.5.330.0070.02017.52
5.5.320.0150.02617.32
5.5.310.0230.02817.45
5.5.300.0070.04216.15
5.5.290.0050.04816.30
5.5.280.0120.04417.50
5.5.270.0040.02517.68
5.5.260.0060.02317.65
5.5.250.0010.02817.49
5.5.240.0050.03417.28
5.5.230.0080.00814.32
5.5.220.0000.01014.56
5.5.210.0130.00314.48
5.5.200.0100.00614.36
5.5.190.0120.00614.45
5.5.180.0070.01014.21
5.5.170.0140.00314.31
5.5.160.0040.01514.31
5.5.150.0060.01014.11
5.5.140.0090.00913.96
5.5.130.0030.01413.92
5.5.120.0070.00314.21
5.5.110.0070.00713.96
5.5.100.0040.01114.39
5.5.90.0100.00314.66
5.5.80.0030.01314.48
5.5.70.0030.01014.43
5.5.60.0000.01514.44
5.5.50.0000.01414.10
5.5.40.0070.00414.45
5.5.30.0070.00714.31
5.5.20.0060.01214.33
5.5.10.0030.01614.50
5.5.00.0070.01414.23
5.4.450.0660.00315.60
5.4.440.0630.00315.50
5.4.430.0600.00315.49
5.4.420.0620.00315.69
5.4.410.0660.00315.64
5.4.400.0630.00315.53
5.4.390.0620.00615.47
5.4.380.0620.00415.40
5.4.370.0620.00515.55
5.4.360.0630.00315.47
5.4.350.0620.00415.52
5.4.340.0580.00615.48
5.4.330.0100.00311.80
5.4.320.0580.00615.48
5.4.310.0620.00415.56
5.4.300.0630.00815.47
5.4.290.0620.00515.42
5.4.280.0610.00115.54
5.4.270.0580.00915.53
5.4.260.0630.00515.47
5.4.250.0600.00815.50
5.4.240.0710.00515.40
5.4.230.0630.00715.55
5.4.220.0650.00815.45
5.4.210.0660.00315.47
5.4.200.0580.00515.50
5.4.190.0610.00115.57
5.4.180.0620.00715.53
5.4.170.0660.00415.45
5.4.160.0630.00415.33
5.4.150.0620.00315.46
5.4.140.0580.00414.06
5.4.130.0550.00314.05
5.4.120.0570.00714.06
5.4.110.0600.00314.14
5.4.100.0550.00414.21
5.4.90.0580.00514.18
5.4.80.0630.00414.13
5.4.70.0050.02214.09
5.4.60.0170.03914.14
5.4.50.0080.03414.06
5.4.40.0030.03314.14
5.4.30.0050.02714.01
5.4.20.0080.03914.11
5.4.10.0170.03714.11
5.4.00.0000.01711.80

preferences:
32.99 ms | 403 KiB | 5 Q