3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isAssoc($array) { return !(bool)count(array_filter(array_keys($array), 'is_string')); } // everything is associative array in PHP. Ideal question to ask is if it sequential var_dump(isAssoc(array())); // true/undefined var_dump(isAssoc(['a'])); // false var_dump(isAssoc([])); // undefined var_dump(isAssoc(array(0 => 'a', 1 => 'b'))); // true var_dump(isAssoc(array(0 => 'a', 5 => 'b'))); // true var_dump(isAssoc(array('a', 'b', 'c'))); // false var_dump(isAssoc(array("0" => 'a', "1" => 'b', "2" => 'c'))); // false var_dump(isAssoc(array("1" => 'a', "0" => 'b', "2" => 'c'))); // true var_dump(isAssoc(array("a" => 'a', "b" => 'b', "c" => 'c'))); // true

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.0110.00716.63
8.3.50.0160.00618.30
8.3.40.0100.00618.64
8.3.30.0040.01118.71
8.3.20.0060.01120.23
8.3.10.0040.00421.91
8.3.00.0060.00319.26
8.2.180.0130.00317.98
8.2.170.0120.00322.96
8.2.160.0060.00920.48
8.2.150.0180.00024.18
8.2.140.0080.00024.66
8.2.130.0030.00619.36
8.2.120.0070.00726.35
8.2.110.0000.00921.04
8.2.100.0090.00317.80
8.2.90.0050.00319.14
8.2.80.0030.00517.97
8.2.70.0040.00417.25
8.2.60.0030.00617.80
8.2.50.0050.00318.07
8.2.40.0040.00419.28
8.2.30.0070.00020.61
8.2.20.0040.00417.74
8.2.10.0050.00317.99
8.2.00.0040.00418.11
8.1.280.0120.00425.92
8.1.270.0060.00323.96
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0100.00021.06
8.1.230.0080.00417.66
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0000.00817.23
8.1.190.0050.00317.35
8.1.180.0080.00018.10
8.1.170.0040.00418.73
8.1.160.0000.00722.01
8.1.150.0040.00418.90
8.1.140.0040.00419.43
8.1.130.0040.00417.56
8.1.120.0070.00017.40
8.1.110.0040.00417.43
8.1.100.0050.00217.42
8.1.90.0000.00817.27
8.1.80.0000.00817.35
8.1.70.0000.00717.36
8.1.60.0080.00017.41
8.1.50.0030.00517.36
8.1.40.0030.00717.47
8.1.30.0060.00317.51
8.1.20.0000.00717.52
8.1.10.0060.00317.34
8.1.00.0040.00417.29
8.0.300.0070.00018.77
8.0.290.0000.00716.63
8.0.280.0040.00418.38
8.0.270.0030.00317.20
8.0.260.0040.00417.22
8.0.250.0000.00716.81
8.0.240.0000.00816.83
8.0.230.0110.00016.86
8.0.220.0030.00516.73
8.0.210.0000.00816.82
8.0.200.0030.00316.80
8.0.190.0070.00016.95
8.0.180.0030.00616.89
8.0.170.0080.00016.77
8.0.160.0070.00016.78
8.0.150.0040.00416.76
8.0.140.0030.00516.69
8.0.130.0040.00413.34
8.0.120.0000.00816.79
8.0.110.0070.00016.72
8.0.100.0070.00016.79
8.0.90.0030.00516.78
8.0.80.0040.01216.85
8.0.70.0050.00316.72
8.0.60.0050.00316.77
8.0.50.0050.00316.63
8.0.30.0070.01317.19
8.0.20.0120.00817.40
8.0.10.0050.00216.73
8.0.00.0070.01216.72
7.4.330.0000.00516.77
7.4.320.0000.00616.44
7.4.300.0060.00016.45
7.4.290.0000.00716.47
7.4.280.0000.00816.47
7.4.270.0000.00816.59
7.4.260.0030.00316.46
7.4.250.0000.00816.50
7.4.240.0040.00416.56
7.4.230.0000.00716.55
7.4.220.0090.01416.66
7.4.210.0080.00616.61
7.4.200.0040.00416.52
7.4.160.0140.00416.44
7.4.150.0110.00717.40
7.4.140.0110.01217.86
7.4.130.0130.00916.42
7.4.120.0120.00616.51
7.4.110.0080.00816.34
7.4.100.0080.00816.23
7.4.90.0130.00316.49
7.4.80.0120.00919.39
7.4.70.0030.01516.44
7.4.60.0080.01116.47
7.4.50.0090.00616.64
7.4.40.0150.00016.29
7.4.30.0130.00816.51
7.4.00.0080.00415.05
7.3.330.0000.00613.29
7.3.320.0030.00313.19
7.3.310.0000.00716.05
7.3.300.0000.00716.25
7.3.290.0080.00016.09
7.3.280.0110.00516.23
7.3.270.0030.01617.40
7.3.260.0070.01016.40
7.3.250.0050.01216.37
7.3.240.0100.00816.32
7.3.230.0060.01216.39
7.3.210.0140.00316.49
7.3.200.0110.01316.43
7.3.190.0100.00716.55
7.3.180.0100.00616.60
7.3.170.0030.01516.27
7.3.160.0080.00816.27
7.2.330.0070.01016.45
7.2.320.0070.01016.38
7.2.310.0130.00316.41
7.2.300.0120.00616.80
7.2.290.0030.02016.83
7.2.110.0130.00716.47
7.2.00.0110.00419.37
7.1.200.0130.00015.68
7.1.100.0030.01618.20
7.1.70.0030.00716.94
7.1.60.0060.00919.48
7.1.50.0060.01916.97
7.1.00.0030.07322.33
7.0.200.0550.00314.50
7.0.60.0100.03320.00
7.0.50.0100.07717.98
7.0.40.0070.05319.96
7.0.30.0230.09020.30
7.0.20.0300.07720.30
7.0.10.0100.08020.10
7.0.00.0000.05020.22
5.6.210.0130.03720.67
5.6.200.0000.04318.18
5.6.190.0030.04320.63
5.6.180.0270.06020.55
5.6.170.0170.05020.57
5.6.160.0000.07320.51
5.6.150.0030.08318.18
5.6.140.0100.06318.23
5.6.130.0170.07718.16
5.6.120.0100.08320.99
5.6.110.0100.08021.02
5.6.100.0000.04721.09
5.6.90.0130.07321.04
5.6.80.0130.07320.41
5.5.350.3500.04020.46
5.5.340.0070.04317.99
5.5.330.0000.09320.41
5.5.320.0130.06020.28
5.5.310.0300.03320.37
5.5.300.0000.04317.96
5.5.290.0030.04317.95
5.5.280.0070.06020.94
5.5.270.0100.07320.88
5.5.260.0100.07720.88
5.5.250.0000.08720.69
5.5.240.0270.07720.19

preferences:
50.71 ms | 401 KiB | 5 Q