3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array("PROPERTIES" => array(1122), "QUANTITY" => "11"), array("PROPERTIES" => array(1123), "QUANTITY" => "12") ); function getQuantityById($id) { for ($arr as $item) { if ($item["PROPERTIES"][0] == $id) return $item["QUEANTITY"]; } return null; } echo getQuantityById(1122);

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.270.0100.05718.80
5.4.260.0100.06018.96
5.4.250.0130.06719.04
5.4.240.0100.05018.80
5.4.230.0130.05018.67
5.4.220.0000.06318.99
5.4.210.0100.05018.99
5.4.200.0130.06319.02
5.4.190.0100.05018.95
5.4.180.0030.05719.00
5.4.170.0030.06019.09
5.4.160.0070.07718.73
5.4.150.0100.05318.79
5.4.140.0130.04716.26
5.4.130.0270.05016.36
5.4.120.0070.05316.34
5.4.110.0100.05316.41
5.4.100.0170.05716.52
5.4.90.0070.06016.49
5.4.80.0130.05316.40
5.4.70.0000.06016.50
5.4.60.0000.05716.60
5.4.50.0070.04716.50
5.4.40.0100.04716.45
5.4.30.0000.05716.36
5.4.20.0130.05016.50
5.4.10.0170.04316.54
5.4.00.0130.04715.96
5.3.280.0100.05014.74
5.3.270.0100.07314.67
5.3.260.0030.05714.77
5.3.250.0030.08014.78
5.3.240.0070.07714.82
5.3.230.0270.05714.42
5.3.220.0000.07314.55
5.3.210.0030.05314.66
5.3.200.0200.05314.65
5.3.190.0100.04714.64
5.3.180.0030.05014.65
5.3.170.0030.07014.46
5.3.160.0000.05714.55
5.3.150.0070.05314.55
5.3.140.0100.05014.56
5.3.130.0100.05314.63
5.3.120.0000.06014.55
5.3.110.0030.05314.57
5.3.100.0070.07014.05
5.3.90.0000.05714.10
5.3.80.0030.05314.01
5.3.70.0070.06714.11
5.3.60.0130.04313.97
5.3.50.0070.05314.04
5.3.40.0130.04714.04
5.3.30.0070.05713.81
5.3.20.0130.04313.60
5.3.10.0070.05313.73
5.3.00.0030.06013.82
5.2.170.0130.04011.13
5.2.160.0000.04711.14
5.2.150.0130.04711.30
5.2.140.0100.03711.35
5.2.130.0000.04311.08
5.2.120.0000.04711.16
5.2.110.0170.03311.31
5.2.100.0200.02711.08
5.2.90.0100.03711.27
5.2.80.0000.04711.04
5.2.70.0030.04311.31
5.2.60.0100.04011.02
5.2.50.0030.04011.25
5.2.40.0000.04310.83
5.2.30.0070.04011.03
5.2.20.0070.03710.86
5.2.10.0070.04010.93
5.2.00.0030.05310.80
5.1.60.0070.0339.95
5.1.50.0070.03310.20
5.1.40.0100.03310.07
5.1.30.0000.04310.23
5.1.20.0070.05010.33
5.1.10.0000.04010.04
5.1.00.0100.03310.22
5.0.50.0030.0308.38
5.0.40.0070.0238.39
5.0.30.0130.0508.18
5.0.20.0030.0278.18
5.0.10.0070.0378.24
5.0.00.0030.0408.12
4.4.90.0030.0276.95
4.4.80.0130.0136.95
4.4.70.0030.0206.95
4.4.60.0030.0206.95
4.4.50.0030.0206.95
4.4.40.0030.0336.95
4.4.30.0070.0176.95
4.4.20.0030.0207.45
4.4.10.0030.0207.45
4.4.00.0000.0377.45
4.3.110.0070.0177.45
4.3.100.0030.0207.45
4.3.90.0000.0237.45
4.3.80.0000.0337.45
4.3.70.0070.0177.45
4.3.60.0000.0237.45
4.3.50.0030.0207.45
4.3.40.0000.0477.45
4.3.30.0070.0177.45
4.3.20.0070.0207.45
4.3.10.0100.0207.45
4.3.00.0070.0237.48

preferences:
137.37 ms | 1394 KiB | 7 Q