3v4l.org

run code in 300+ PHP versions simultaneously
<?php $shipArr = [ [ 'ship_cost' => '1', 'country_id' => '1', 'country_code' => 'US', 'country_name' => 'United States', ], [ 'ship_cost' => '0', 'country_id' => '0', 'country_code' => '', 'country_name' => false, ] ]; $user_country_id = 1; var_export( array_find( $shipArr, fn($row) => $row['country_id'] == $user_country_id )['ship_cost'] ?? 0 );

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.00.0100.01120.07
8.4.150.0030.00014.05
8.4.140.0170.00417.64
8.4.130.0120.00918.00
8.4.120.0120.00820.53
8.4.110.0120.00918.54
8.4.100.0110.00817.80
8.4.90.0130.00917.65
8.4.80.0060.00319.75
8.4.70.0030.00517.91
8.4.60.0070.01218.83
8.4.50.0090.01020.35
8.4.40.0080.00018.95
8.4.30.0130.00618.65
8.4.20.0210.00021.21
8.4.10.0160.00319.51
8.3.280.0130.00820.21
8.3.270.0100.00816.52
8.3.260.0070.01116.93
8.3.250.0130.00618.68
8.3.240.0090.00116.51
8.3.230.0120.00716.79
8.3.220.0100.00816.80
8.3.210.0100.00916.91
8.3.200.0080.00116.45
8.3.190.0040.00517.29
8.3.180.0120.00618.56
8.3.170.0090.00916.70
8.3.160.0070.00720.68
8.3.150.0030.01217.01
8.3.140.0070.00718.29
8.3.130.0150.00618.28
8.3.120.0150.00818.48
8.3.110.0170.00718.28
8.3.100.0130.00616.36
8.3.90.0100.01018.27
8.3.80.0200.00016.55
8.3.70.0210.00016.48
8.3.60.0130.00716.58
8.3.50.0120.00916.61
8.3.40.0140.00317.45
8.3.30.0060.01117.19
8.3.20.0110.00817.40
8.3.10.0060.01217.48
8.3.00.0070.00317.41
8.2.290.0110.00720.32
8.2.280.0080.01218.48
8.2.270.0060.01016.89
8.2.260.0150.00316.84
8.2.250.0150.00216.73
8.2.240.0170.00016.34
8.2.230.0160.00316.68
8.2.220.0100.00716.40
8.2.210.0140.00416.61
8.2.200.0090.00916.31
8.2.190.0140.00316.72
8.2.180.0150.00416.37
8.2.170.0160.00417.61
8.2.160.0140.00517.42
8.2.150.0160.00317.29
8.2.140.0150.00317.08
8.2.130.0110.00617.23
8.2.120.0130.00717.52
8.2.110.0070.01117.39
8.2.100.0180.00017.45
8.2.90.0150.00317.38
8.2.80.0170.00317.34
8.2.70.0180.00317.23
8.2.60.0120.00617.34
8.2.50.0110.00717.45
8.2.40.0170.00017.23
8.2.30.0170.00017.25
8.2.20.0110.00517.36
8.2.10.0110.00517.45
8.2.00.0190.00317.13
8.1.330.0100.00916.61
8.1.320.0130.00816.15
8.1.310.0180.00015.84
8.1.300.0150.00416.24
8.1.290.0120.00618.01
8.1.280.0130.00416.33
8.1.270.0150.00417.04
8.1.260.0050.01017.35
8.1.250.0060.01217.09
8.1.240.0160.00017.18
8.1.230.0100.00717.11
8.1.220.0130.00317.20
8.1.210.0180.00018.75
8.1.200.0160.00017.11
8.1.190.0140.00316.98
8.1.180.0060.01017.23
8.1.170.0120.00416.95
8.1.160.0130.00317.18
8.1.150.0110.00516.80
8.1.140.0050.01117.10
8.1.130.0100.00517.01
8.1.120.0120.00417.30
8.1.110.0110.00417.06
8.1.100.0140.00217.11
8.1.90.0080.00816.95
8.1.80.0160.00017.06
8.1.70.0060.01116.85
8.1.60.0140.00517.11
8.1.50.0160.00317.55
8.1.40.0140.00517.30
8.1.30.0080.01217.19
8.1.20.0150.00619.04
8.1.10.0140.00517.45
8.1.00.0170.00019.16

preferences:
49.32 ms | 403 KiB | 5 Q