3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[{"name":"Juan","Sex":"Male","ID":"1100"},{"name":"Maria","Sex":"Female","ID":"2513"},{"name":"Pedro","Sex":"Male","ID":"2211"}]'; $array = json_decode($json,1); $sex = ‘Male’ $expected = array_filter($array, function ($var) use ($sex) { return ($var['sex'] == $sex); }); print_r($expected); ?>

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.130.0310.01016.52
8.3.120.0360.00616.71
8.3.110.0300.01216.49
8.3.100.0410.00816.68
8.3.90.0430.00816.54
8.3.80.0380.01016.63
8.3.70.0470.00316.40
8.3.60.0350.00416.45
8.3.50.0260.00416.38
8.3.40.0140.00317.67
8.3.30.0150.00417.52
8.3.20.0270.01017.32
8.3.10.0380.00017.44
8.3.00.0210.00017.54
8.2.250.0290.01016.38
8.2.240.0290.00716.80
8.2.230.0220.01116.37
8.2.220.0160.01216.36
8.2.210.0250.00916.30
8.2.200.0400.00316.47
8.2.190.0180.01116.38
8.2.180.0170.01316.18
8.2.170.0260.00617.52
8.2.160.0130.00517.54
8.2.150.0330.00317.10
8.2.140.0260.00717.23
8.2.130.0170.00317.32
8.2.120.0230.01917.49
8.2.110.0380.00417.38
8.2.100.0230.00317.46
8.2.90.0390.00317.44
8.2.80.0350.00517.27
8.2.70.0370.01017.25
8.2.60.0370.00617.29
8.2.50.0400.00017.11
8.2.40.0330.00717.14
8.2.30.0270.01117.21
8.2.20.0290.01017.33
8.2.10.0360.00317.51
8.2.00.0260.01316.93
8.1.300.0260.01516.18
8.1.290.0250.00616.18
8.1.280.0200.00316.18
8.1.270.0280.00317.10
8.1.260.0280.00316.79
8.1.250.0340.00017.07
8.1.240.0130.00417.19
8.1.230.0150.00416.88
8.1.220.0110.00716.96
8.1.210.0190.00016.95
8.1.200.0090.00916.86
8.1.190.0170.00017.06
8.1.180.0270.01017.07
8.1.170.0230.00917.19
8.1.160.0280.00916.95
8.1.150.0330.00416.95
8.1.140.0320.00316.91
8.1.130.0220.01417.14
8.1.120.0230.01317.20
8.1.110.0110.00817.17
8.1.100.0220.01617.03
8.1.90.0370.00717.06
8.1.80.0340.00617.11
8.1.70.0300.00616.99
8.1.60.0270.01217.12
8.1.50.0310.00917.20
8.1.40.0280.01616.97
8.1.30.0230.01917.27
8.1.20.0360.00417.11
8.1.10.0300.01117.06
8.1.00.0300.01017.04

preferences:
134.88 ms | 1432 KiB | 7 Q