3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = array(12,14); $all = array( array( "lid" => 4, "name" => "aaaaa" ), array( "lid" => 12, "name" => "s" ), array( "lid" => 13, "name" => "aaa" ), array( "lid" => 14, "name" => "bbb" ) ); $i = 0; foreach ( $all as $each ) { if ( in_array($each,$now) ) { $all[$i]['ext'] = 1; } else { $all[$i]['ext'] = 0; } $i++; } print_r($all); foreach ($all as &$item) { $item['ext'] = (in_array($item['lid'], $now) ? 1 : 0); } print_r($item);

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.00316.75
8.3.50.0110.00822.82
8.3.40.0070.00718.70
8.3.30.0070.00719.22
8.3.20.0050.00220.25
8.3.10.0030.00523.70
8.3.00.0040.00419.68
8.2.180.0110.00416.50
8.2.170.0100.00722.96
8.2.160.0090.00620.32
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00419.48
8.2.110.0090.00021.11
8.2.100.0060.00617.63
8.2.90.0080.00018.03
8.2.80.0060.00317.97
8.2.70.0090.00017.48
8.2.60.0030.00617.93
8.2.50.0090.00018.07
8.2.40.0050.00318.34
8.2.30.0070.00019.53
8.2.20.0080.00017.65
8.2.10.0040.00418.22
8.2.00.0030.00717.77
8.1.280.0170.00025.92
8.1.270.0080.00023.91
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00322.15
8.1.230.0100.00019.05
8.1.220.0040.00417.78
8.1.210.0000.00818.89
8.1.200.0000.01017.35
8.1.190.0080.00017.55
8.1.180.0000.00819.14
8.1.170.0060.00318.50
8.1.160.0040.00418.79
8.1.150.0070.00018.87
8.1.140.0000.00817.46
8.1.130.0030.00617.90
8.1.120.0040.00417.49
8.1.110.0000.00717.47
8.1.100.0020.00517.52
8.1.90.0000.00917.39
8.1.80.0000.00817.45
8.1.70.0030.00317.34
8.1.60.0020.00517.66
8.1.50.0050.00317.44
8.1.40.0050.00217.45
8.1.30.0030.00617.67
8.1.20.0000.00717.52
8.1.10.0030.00517.42
8.1.00.0070.00017.48
8.0.300.0000.00719.81
8.0.290.0000.00717.05
8.0.280.0030.00318.58
8.0.270.0030.00317.29
8.0.260.0030.00317.32
8.0.250.0030.00317.03
8.0.240.0000.00716.89
8.0.230.0030.00316.88
8.0.220.0000.00716.96
8.0.210.0030.00316.79
8.0.200.0070.00016.91
8.0.190.0030.00617.01
8.0.180.0050.00316.96
8.0.170.0000.00816.89
8.0.160.0030.00316.93
8.0.150.0050.00316.86
8.0.140.0070.00016.93
8.0.130.0030.00313.39
8.0.120.0050.00316.93
8.0.110.0000.00716.95
8.0.100.0000.00816.77
8.0.90.0070.00016.99
8.0.80.0070.01416.91
8.0.70.0000.00816.97
8.0.60.0040.00416.77
8.0.50.0000.00716.95
8.0.30.0090.00917.10
8.0.20.0110.00817.40
8.0.10.0040.00417.07
8.0.00.0050.01216.70
7.4.330.0020.00215.02
7.4.320.0060.00016.58
7.4.300.0000.00716.39
7.4.290.0000.00716.39
7.4.280.0070.00016.46
7.4.270.0030.00316.62
7.4.260.0000.00816.47
7.4.250.0000.00816.48
7.4.240.0040.00316.57
7.4.230.0030.00416.44
7.4.220.0030.01216.54
7.4.210.0090.00616.50
7.4.200.0000.00716.43
7.4.160.0120.00416.58
7.4.150.0060.01217.40
7.4.140.0070.01217.86
7.4.130.0100.00716.49
7.4.120.0040.01216.54
7.4.110.0100.01016.50
7.4.100.0160.00916.46
7.4.90.0030.01416.59
7.4.80.0110.01119.39
7.4.70.0130.00816.48
7.4.60.0130.00316.46
7.4.50.0000.00916.60
7.4.40.0070.01016.64
7.4.30.0130.00316.39
7.4.00.0110.00415.11
7.3.330.0000.00513.27
7.3.320.0030.00313.19
7.3.310.0030.00316.31
7.3.300.0050.00216.34
7.3.290.0110.00816.41
7.3.280.0090.00916.35
7.3.270.0090.00917.40
7.3.260.0100.00716.47
7.3.250.0130.00516.35
7.3.240.0050.01216.46
7.3.230.0140.00316.65
7.3.210.0030.01216.46
7.3.200.0090.01319.39
7.3.190.0060.01516.68
7.3.180.0060.01116.59
7.3.170.0110.00616.27
7.3.160.0090.01016.67
7.2.330.0100.01016.41
7.2.320.0100.01316.42
7.2.310.0130.00416.47
7.2.300.0190.00316.73
7.2.290.0180.00016.75
7.2.60.0070.00716.79
7.2.00.0030.01219.45
7.1.200.0240.00015.44
7.1.100.0040.01118.07
7.1.70.0070.00017.28
7.1.60.0110.01519.34
7.1.50.0030.02116.96
7.1.00.0070.07322.29
7.0.200.0000.01016.81
7.0.140.0030.07022.18
7.0.60.0030.06719.91
7.0.50.0030.04317.86
7.0.40.0100.05020.24
7.0.30.0500.05020.25
7.0.20.0330.05020.23
7.0.10.0130.08720.26
7.0.00.0070.05320.17
5.6.280.0100.06721.14
5.6.210.0100.05320.64
5.6.200.0030.04718.12
5.6.190.0000.06320.43
5.6.180.0200.06320.52
5.6.170.0230.05320.34
5.6.160.0100.07020.55
5.6.150.0100.06318.15
5.6.140.0100.07718.16
5.6.130.0030.04718.14
5.6.120.0170.07321.09
5.6.110.0170.06321.01
5.6.100.0100.05721.02
5.6.90.0130.07320.87
5.6.80.0070.08720.52
5.5.350.0000.03320.40
5.5.340.0070.07717.95
5.5.330.0100.05020.40
5.5.320.4030.04320.51
5.5.310.0370.07320.23
5.5.300.0070.04317.98
5.5.290.0000.08318.02
5.5.280.0100.08320.87
5.5.270.0070.08020.74
5.5.260.0100.08320.85
5.5.250.0130.03020.46
5.5.240.0030.03720.05
5.4.450.4030.04319.44
5.4.440.0070.08019.27
5.4.430.1470.04319.43
5.4.420.3670.04019.27
5.4.410.5000.04019.26
5.4.400.3300.04019.01
5.4.390.2400.03719.01
5.4.380.2730.03318.95
5.4.370.3570.04719.01
5.4.360.2970.03319.02
5.4.350.3470.03718.91
5.4.340.3200.04019.11
5.4.320.4670.02319.11
5.4.310.3300.04019.10
5.4.300.3730.04019.02
5.4.290.3700.03318.90
5.4.280.2930.04319.18
5.4.270.3230.03719.15
5.4.260.3870.04318.95
5.4.250.3830.05019.10
5.4.240.3530.03719.01
5.4.230.4400.02719.15
5.4.220.3470.03719.14
5.4.210.3370.04019.00
5.4.200.4030.04019.11
5.4.190.4230.04319.01
5.4.180.3530.03719.16
5.4.170.3730.04019.01
5.4.160.3330.03719.15
5.4.150.3770.04319.08
5.4.140.3270.03716.46
5.4.130.3330.03316.47
5.4.120.4300.03316.29
5.4.110.3730.03316.53
5.4.100.4030.03316.31
5.4.90.4070.03716.53
5.4.80.4170.03316.26
5.4.70.4200.04016.16
5.4.60.4230.03316.43
5.4.50.4300.04016.47
5.4.40.4030.04016.43
5.4.30.4200.03716.43
5.4.20.4530.03016.43
5.4.10.3300.03716.15
5.4.00.3370.02015.98
5.3.290.3600.04014.68
5.3.280.3970.03314.59
5.3.270.3400.04014.76
5.3.260.3600.03314.76
5.3.250.3600.04014.60
5.3.240.3900.03714.64
5.3.230.4130.04014.48
5.3.220.4200.03314.61
5.3.210.3970.03314.45
5.3.200.4130.03314.45
5.3.190.4400.03714.45
5.3.180.4100.04014.63
5.3.170.4300.04014.45
5.3.160.4270.03714.55
5.3.150.4230.04014.58
5.3.140.3900.03714.57
5.3.130.3930.04314.61
5.3.120.3330.04314.57
5.3.110.3530.03314.70
5.3.100.3400.04014.04
5.3.90.3670.03314.04
5.3.80.3370.04313.93
5.3.70.3300.03713.94
5.3.60.3730.03713.96
5.3.50.4200.03713.87
5.3.40.3830.04013.91
5.3.30.3270.03713.90
5.3.20.3400.03313.76
5.3.10.4070.04013.60
5.3.00.3330.03313.53
5.2.170.3700.02711.20
5.2.160.3530.03011.32
5.2.150.2700.03011.04
5.2.140.3470.02711.18
5.2.130.2900.02711.14
5.2.120.2670.03011.27
5.2.110.3130.02311.14
5.2.100.2830.03011.11
5.2.90.2530.03311.18
5.2.80.2770.03311.09
5.2.70.2900.03011.10
5.2.60.3000.03011.02
5.2.50.3630.03311.01
5.2.40.2800.03310.99
5.2.30.2470.03011.03
5.2.20.2830.03310.92
5.2.10.2630.02710.87
5.2.00.2600.03310.64
5.1.60.2530.03010.01
5.1.50.2470.0279.90
5.1.40.3030.0209.96
5.1.30.2900.03310.39
5.1.20.2700.03310.39
5.1.10.2370.02310.21
5.1.00.2400.03310.14
5.0.50.1130.0138.46
5.0.40.1170.0178.32
5.0.30.1130.0278.22
5.0.20.0970.0138.18
5.0.10.1100.0178.33
5.0.00.1100.0308.31
4.4.90.1200.0207.79
4.4.80.1230.0137.79
4.4.70.1770.0177.79
4.4.60.1330.0137.79
4.4.50.1300.0177.79
4.4.40.1330.0307.79
4.4.30.1370.0207.79
4.4.20.1270.0207.79
4.4.10.1230.0177.79
4.4.00.1100.0277.79
4.3.110.1100.0137.79
4.3.100.1130.0137.79
4.3.90.1100.0137.79
4.3.80.1030.0237.79
4.3.70.1130.0137.79
4.3.60.1130.0137.79
4.3.50.1100.0137.79
4.3.40.1070.0237.79
4.3.30.0500.0177.79
4.3.20.0570.0137.79
4.3.10.0570.0137.79
4.3.00.0530.0177.79

preferences:
59.24 ms | 401 KiB | 5 Q