3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sales_people = array( '2' => array( 'states' => array('NY', 'NJ', 'CT', 'MA', 'VT', 'ME'), 'codes' => array('CA1', 'US7', 'UT9') ), '5' => array( 'states' => array('FL', 'GA', 'SC', 'NC', 'TN'), 'codes' => array('VA4', 'VA8', 'VA3') ) ); function searchSubsets($sets, $needle): ?int { foreach ($sets as $id => $haystacks) { foreach ($haystacks as $haystack) { if (in_array($needle, $haystack)) { return $id; } } } return null; } var_export(searchSubsets($sales_people, 'CT'));

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.5.30.0120.00819.60
8.5.20.0100.00820.21
8.5.10.0010.00716.55
8.5.00.0120.01019.80
8.4.180.0170.00622.09
8.4.170.0100.01223.89
8.4.160.0140.01120.48
8.4.150.0080.00516.80
8.4.140.0090.01217.59
8.4.130.0140.00719.02
8.4.120.0120.00820.67
8.4.110.0150.00518.84
8.4.100.0130.00717.85
8.4.90.0100.00920.77
8.4.80.0110.00818.97
8.4.70.0120.00718.96
8.4.60.0120.00920.81
8.4.50.0090.01118.59
8.4.40.0190.00317.85
8.4.30.0130.00618.52
8.4.20.0080.00819.54
8.4.10.0160.00319.29
8.3.300.0110.01020.54
8.3.290.0100.00920.68
8.3.280.0110.01020.22
8.3.270.0110.00916.36
8.3.260.0030.00616.56
8.3.250.0080.01216.34
8.3.240.0040.00516.79
8.3.230.0040.00416.85
8.3.220.0110.00719.03
8.3.210.0100.00816.41
8.3.200.0060.00316.63
8.3.190.0090.00616.98
8.3.180.0100.00522.49
8.3.170.0140.00317.11
8.3.160.0120.00616.71
8.3.150.0140.00716.45
8.3.140.0080.00016.72
8.3.130.0040.00417.10
8.3.120.0070.00718.84
8.3.110.0080.00016.60
8.3.100.0000.00916.64
8.3.90.0070.00026.77
8.3.80.0070.00417.97
8.3.70.0120.00916.25
8.3.60.0090.00618.06
8.3.50.0040.01118.52
8.3.40.0000.01421.97
8.3.30.0130.00320.38
8.3.20.0140.00725.66
8.3.10.0150.00625.66
8.3.00.0100.01025.66
8.2.300.0100.01520.35
8.2.290.0110.00817.00
8.2.280.0100.01118.31
8.2.270.0100.01316.94
8.2.260.0040.00417.12
8.2.250.0040.00416.69
8.2.240.0100.01018.88
8.2.230.0040.00420.94
8.2.220.0060.00324.06
8.2.210.0070.01126.77
8.2.200.0040.00418.16
8.2.190.0130.00716.75
8.2.180.0180.00416.88
8.2.170.0100.00618.84
8.2.160.0110.00422.96
8.2.150.0190.00325.66
8.2.140.0120.00925.66
8.2.130.0140.00325.66
8.2.120.0090.00925.66
8.2.110.0100.00725.66
8.2.100.0110.01125.66
8.2.90.0140.00425.66
8.2.80.0210.00025.66
8.2.70.0170.00325.66
8.2.60.0130.00325.66
8.2.50.0100.00725.66
8.2.40.0070.01025.66
8.2.30.0210.00025.66
8.2.20.0100.00725.66
8.2.10.0130.00625.66
8.2.00.0070.01125.66
8.1.340.0170.01021.92
8.1.330.0110.00716.27
8.1.320.0130.00616.29
8.1.310.0120.00616.55
8.1.300.0090.00020.21
8.1.290.0000.00930.84
8.1.280.0150.00625.92
8.1.270.0080.00825.66
8.1.260.0120.00325.66
8.1.250.0070.00725.66
8.1.240.0070.00725.66
8.1.230.0080.00825.66
8.1.220.0110.00425.66
8.1.210.0110.00425.66
8.1.200.0140.00025.66
8.1.190.0090.00525.66
8.1.180.0110.00425.66
8.1.170.0140.00025.66
8.1.160.0140.00025.66
8.1.150.0070.00725.66
8.1.140.0040.01125.66
8.1.130.0140.00025.66
8.1.120.0120.00325.66
8.1.110.0090.00625.66
8.1.100.0080.00825.66
8.1.90.0080.00625.66
8.1.80.0060.00925.66
8.1.70.0140.00025.66
8.1.60.0080.00825.66
8.1.50.0140.00025.66
8.1.40.0110.00425.66
8.1.30.0090.00625.66
8.1.20.0120.00325.66
8.1.10.0070.00725.66
8.1.00.0110.00425.66

preferences:
56.31 ms | 981 KiB | 5 Q