3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id=5; $allProducts[] = array('itemid'=>$id,'qty' => 1); $allProducts[] = array('itemid'=>6,'qty' => 1); // old version if(array_search($id,array_column($allProducts, 'itemid'))) { echo "an item was found\n"; // will not work } else { echo "NO Item was found, though it should be there\n"; } // corrected version if(array_search($id,array_column($allProducts, 'itemid')) !== false) { echo "an item was found and has the key " .array_search($id,array_column($allProducts, 'itemid')); }

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.70.0120.00618.55
8.3.60.0130.00618.18
8.3.50.0080.00617.11
8.3.40.0150.00018.78
8.3.30.0110.00418.89
8.3.20.0040.00418.71
8.3.10.0040.00423.65
8.3.00.0040.00421.98
8.2.190.0000.01416.58
8.2.180.0180.00016.73
8.2.170.0070.01118.86
8.2.160.0120.00322.96
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00422.13
8.2.120.0080.00026.35
8.2.110.0000.00922.08
8.2.100.0090.00317.84
8.2.90.0040.00422.18
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00417.63
8.2.50.0050.00317.75
8.2.40.0050.00319.46
8.2.30.0050.00319.40
8.2.20.0000.00718.02
8.2.10.0040.00418.17
8.2.00.0050.00317.54
8.1.280.0040.01125.92
8.1.270.0000.00720.33
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00722.59
8.1.230.0110.00021.02
8.1.220.0050.00317.78
8.1.210.0040.00418.88
8.1.200.0090.00017.36
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0080.00018.62
8.1.160.0000.00718.89
8.1.150.0040.00418.89
8.1.140.0000.00721.96
8.1.130.0000.00720.15
8.1.120.0070.00017.33
8.1.110.0040.00417.47
8.1.100.0030.00317.31
8.1.90.0040.00417.33
8.1.80.0050.00517.46
8.1.70.0000.00717.31
8.1.60.0060.00317.48
8.1.50.0040.00417.36
8.1.40.0030.00617.47
8.1.30.0040.00417.65
8.1.20.0040.00417.58
8.1.10.0050.00317.56
8.1.00.0040.00417.49
8.0.300.0040.00419.90
8.0.290.0050.00316.75
8.0.280.0060.00318.42
8.0.270.0030.00317.26
8.0.260.0030.00321.99
8.0.250.0030.00317.01
8.0.240.0050.00216.88
8.0.230.0030.00316.85
8.0.220.0040.00416.90
8.0.210.0080.00016.95
8.0.200.0060.00016.84
8.0.190.0040.00416.86
8.0.180.0040.00416.91
8.0.170.0050.00316.92
8.0.160.0000.00716.96
8.0.150.0030.00316.90
8.0.140.0030.00416.88
8.0.130.0030.00313.27
8.0.120.0040.00416.79
8.0.110.0030.00616.75
8.0.100.0000.00716.66
8.0.90.0000.00716.86
8.0.80.0080.00816.87
8.0.70.0070.00016.88
8.0.60.0000.00816.89
8.0.50.0040.00416.88
8.0.30.0130.00717.02
8.0.20.0090.00917.40
8.0.10.0000.00816.79
8.0.00.0100.00816.66
7.4.330.0020.00215.55
7.4.320.0030.00316.62
7.4.300.0060.00016.43
7.4.290.0000.00816.66
7.4.280.0040.00416.65
7.4.270.0000.00916.54
7.4.260.0040.00416.62
7.4.250.0040.00416.58
7.4.240.0000.00716.52
7.4.230.0030.00316.61
7.4.220.0080.00016.69
7.4.210.0130.00716.64
7.4.200.0050.00216.69
7.4.160.0110.00816.47
7.4.140.0110.00617.86
7.4.130.0030.01316.43
7.4.120.0100.00916.55
7.4.110.0070.01116.60
7.4.100.0040.01616.54
7.4.90.0070.01016.71
7.4.80.0050.01019.39
7.4.70.0110.00616.54
7.4.60.0110.00716.51
7.4.50.0000.01916.32
7.4.40.0100.00716.49
7.4.10.0090.00615.19
7.4.00.0090.00714.85
7.3.330.0000.00613.14
7.3.320.0050.00013.12
7.3.310.0000.00716.43
7.3.300.0030.00316.31
7.3.290.0000.00716.29
7.3.280.0110.00516.26
7.3.260.0080.01116.33
7.3.240.0100.00716.41
7.3.230.0080.00816.66
7.3.210.0090.00616.19
7.3.200.0130.00316.40
7.3.190.0130.00616.38
7.3.180.0120.00316.61
7.3.170.0170.00316.59
7.3.160.0090.01516.39
7.3.130.0070.01015.14
7.3.120.0020.01414.84
7.3.110.0120.00714.87
7.3.100.0070.00714.77
7.3.90.0050.01214.82
7.3.80.0090.00214.75
7.3.70.0120.00314.90
7.3.60.0020.00814.79
7.3.50.0040.00714.74
7.3.40.0050.00714.85
7.3.30.0050.00914.66
7.3.20.0050.00816.60
7.3.10.0030.00916.68
7.3.00.0070.00616.32
7.2.330.0100.01016.50
7.2.320.0120.00616.75
7.2.310.0160.00716.74
7.2.300.0160.00016.48
7.2.290.0060.01516.56
7.2.260.0000.01914.94
7.2.250.0060.01315.09
7.2.240.0110.00514.80
7.2.230.0050.01214.89
7.2.220.0060.00915.01
7.2.210.0070.00915.13
7.2.200.0020.01115.05
7.2.190.0020.01315.08
7.2.180.0060.00714.79
7.2.170.0050.00914.95
7.2.160.0050.00614.89
7.2.150.0030.00816.88
7.2.140.0020.01216.70
7.2.130.0050.00617.01
7.2.120.0030.00916.77
7.2.110.0330.00816.06
7.2.100.0370.00916.10
7.2.90.0330.00416.12
7.2.80.0380.01016.26
7.2.70.0420.00916.26
7.2.60.0360.01116.32
7.2.50.0440.01116.25
7.2.40.0330.01016.26
7.2.30.0410.00516.22
7.2.20.0400.01016.17
7.2.10.0410.00916.29
7.2.00.0420.00816.25
7.1.330.0110.00515.81
7.1.320.0020.01315.74
7.1.310.0080.00515.91
7.1.300.0070.00815.71
7.1.290.0070.00715.75
7.1.280.0060.00615.68
7.1.270.0020.00915.78
7.1.260.0060.00615.75
7.1.250.0030.00715.69
7.1.240.0060.00615.54
7.1.230.0280.01115.08
7.1.220.0360.01015.19
7.1.210.0500.00915.14
7.1.200.0410.00315.01
7.1.190.0360.00715.16
7.1.180.0420.00614.93
7.1.170.0380.00914.98
7.1.160.0330.00915.04
7.1.150.0330.00814.90
7.1.140.0400.00915.27
7.1.130.0400.00815.13
7.1.120.0400.00715.20
7.1.110.0330.00715.17
7.1.100.0430.00715.19
7.1.90.0420.00715.25
7.1.80.0340.01115.10
7.1.70.0620.00515.12
7.1.60.0420.00921.06
7.1.50.0500.00821.04
7.1.40.0480.00821.12
7.1.30.0500.00821.17
7.1.20.0520.00521.13
7.1.10.0430.00614.99
7.1.00.0410.00815.06
7.0.330.0040.00715.31
7.0.320.0020.01315.41
7.0.310.0050.00515.46
7.0.300.0060.00815.40
7.0.290.0060.00315.17
7.0.280.0020.01115.15
7.0.270.0050.00815.25
7.0.260.0090.00115.24
7.0.250.0040.00615.40
7.0.240.0090.00215.40
7.0.230.0050.01015.40
7.0.220.0070.00715.33
7.0.210.0040.00615.25
7.0.200.0030.00915.27
7.0.190.0020.01215.40
7.0.180.0070.00515.40
7.0.170.0050.00515.29
7.0.160.0070.00315.52
7.0.150.0030.01015.45
7.0.140.0050.00815.38
7.0.130.0050.00515.42
7.0.120.0070.00515.25
7.0.110.0060.00815.47
7.0.100.0060.00815.42
7.0.90.0000.01315.46
7.0.80.0060.00615.39
7.0.70.0050.00815.24
7.0.60.0060.00915.55
7.0.50.0030.01015.27
7.0.40.0020.01213.53
7.0.30.0070.00613.57
7.0.20.0050.01013.56
7.0.10.0040.01013.50
7.0.00.0050.00813.38
5.6.400.0030.00914.44
5.6.390.0090.00814.07
5.6.380.0080.00414.49
5.6.370.0060.00314.40
5.6.360.0070.00714.30
5.6.350.0050.00914.51
5.6.340.0060.00814.38
5.6.330.0080.00514.48
5.6.320.0100.00314.31
5.6.310.0030.00714.38
5.6.300.0060.00814.77
5.6.290.0020.00914.35
5.6.280.0100.00414.55
5.6.270.0090.00514.35
5.6.260.0080.00614.37
5.6.250.0050.00514.22
5.6.240.0070.00714.42
5.6.230.0000.01214.39
5.6.220.0020.01314.21
5.6.210.0050.00814.58
5.6.200.0070.00714.24
5.6.190.0080.00514.33
5.6.180.0060.00714.53
5.6.170.0050.00814.26
5.6.160.0060.00614.37
5.6.150.0070.00614.18
5.6.140.0050.01114.21
5.6.130.0030.01314.31
5.6.120.0070.00614.25
5.6.110.0050.00714.61
5.6.100.0070.00714.11
5.6.90.0080.00814.37
5.6.80.0060.00814.37
5.6.70.0020.01314.36
5.6.60.0050.00914.17
5.6.50.0050.01214.44
5.6.40.0050.00714.34
5.6.30.0050.01014.36
5.6.20.0030.01014.40
5.6.10.0050.01014.40
5.6.00.0100.00614.34

preferences:
47.34 ms | 401 KiB | 5 Q