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)
5.4.360.0130.04718.56
5.4.350.0130.03313.80
5.4.340.0070.03714.01
5.4.320.0170.03314.28
5.4.310.0070.04014.41
5.4.300.0070.04714.27
5.4.290.0070.05014.26
5.4.280.0070.03714.19
5.4.270.0100.03714.16
5.4.260.0030.04314.15
5.4.250.0130.03314.11
5.4.240.0070.03314.11
5.4.230.0070.04014.21
5.4.220.0000.04314.14
5.4.210.0130.03314.16
5.4.200.0170.03014.16
5.4.190.0170.02714.16
5.4.180.0030.04014.38
5.4.170.0130.03314.09
5.4.160.0030.04314.28
5.4.150.0170.03014.16
5.4.140.0070.04013.89
5.4.130.0100.03713.81
5.4.120.0070.04313.79
5.4.110.0200.03013.73
5.4.100.0130.03713.78
5.4.90.0070.04013.84
5.4.80.0100.03713.77
5.4.70.0030.04013.76
5.4.60.0070.03713.78
5.4.50.0070.03713.83
5.4.40.0100.03313.79
5.4.30.0070.04013.84
5.4.20.0030.03713.78
5.4.10.0070.03713.83
5.4.00.0100.03713.23
5.3.290.0100.03714.56
5.3.280.0100.03714.53
5.3.270.0100.03714.53
5.3.260.0200.03314.46
5.3.250.0070.04014.53
5.3.240.0030.05014.62
5.3.230.0100.05314.64
5.3.220.0070.04714.62
5.3.210.0070.04014.62
5.3.200.0100.03314.48
5.3.190.0070.04014.57
5.3.180.0100.03714.48
5.3.170.0070.04014.50
5.3.160.0130.03314.41
5.3.150.0070.04014.54
5.3.140.0100.04314.61
5.3.130.0130.04314.60
5.3.120.0100.04314.60
5.3.110.0030.04714.61
5.3.100.0030.04314.07
5.3.90.0070.04314.02
5.3.80.0070.04013.97
5.3.70.0100.04013.99
5.3.60.0170.03013.92
5.3.50.0030.04313.80
5.3.40.0170.03013.88
5.3.30.0070.03713.90
5.3.20.0070.03713.62
5.3.10.0070.04013.60
5.3.00.0030.04313.63
5.2.170.0100.02711.06
5.2.160.0070.03011.20
5.2.150.0070.03711.10
5.2.140.0070.04011.06
5.2.130.0070.04011.07
5.2.120.0130.03311.07
5.2.110.0200.02711.08
5.2.100.0070.04010.97
5.2.90.0070.03011.10
5.2.80.0030.03310.98
5.2.70.0070.03010.95
5.2.60.0000.04011.13
5.2.50.0000.03311.00
5.2.40.0070.02710.84
5.2.30.0000.03310.93
5.2.20.0100.03010.89
5.2.10.0030.03310.81
5.2.00.0000.03310.76
5.1.60.0070.0239.95
5.1.50.0070.0309.99
5.1.40.0000.03010.10
5.1.30.0000.03310.45
5.1.20.0030.03010.27
5.1.10.0100.02310.15
5.1.00.0070.03010.04
5.0.50.0000.0278.56
5.0.40.0030.0208.39
5.0.30.0030.0308.16
5.0.20.0070.0178.32
5.0.10.0000.0238.18
5.0.00.0030.0308.14
4.4.90.0030.0175.84
4.4.80.0030.0135.76
4.4.70.0100.0105.81
4.4.60.0070.0135.76
4.4.50.0070.0135.86
4.4.40.0000.0275.82
4.4.30.0030.0175.85
4.4.20.0030.0135.88
4.4.10.0030.0235.87
4.4.00.0130.0235.88
4.3.110.0030.0235.79
4.3.100.0000.0205.79
4.3.90.0130.0075.85
4.3.80.0070.0335.79
4.3.70.0070.0175.74
4.3.60.0030.0205.84
4.3.50.0070.0205.73
4.3.40.0030.0275.86
4.3.30.0000.0204.53
4.3.20.0000.0174.56
4.3.10.0000.0204.60
4.3.00.0030.01715.77

preferences:
143.5 ms | 1394 KiB | 7 Q