3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"locations":"Bangalore","requestor_department":"DC","requestor_department_count":"3"}{"locations":"Bangalore","requestor_department":"EBA","requestor_department_count":"1"}{"locations":"Chennai","requestor_department":"DC","requestor_department_count":"34"}{"locations":"Chennai","requestor_department":"EBA","requestor_department_count":"20"}{"locations":"Cochin","requestor_department":"DC","requestor_department_count":"4"}{"locations":"Cochin","requestor_department":"EBA","requestor_department_count":"2"}{"locations":"Hyderabad","requestor_department":"DC","requestor_department_count":"58"}{"locations":"Hyderabad","requestor_department":"EBA","requestor_department_count":"18"}{"locations":"Kolkata","requestor_department":"DC","requestor_department_count":"37"}{"locations":"Kolkata","requestor_department":"EBA","requestor_department_count":"8"}{"locations":"Pune","requestor_department":"DC","requestor_department_count":"26"}{"locations":"Pune","requestor_department":"EBA","requestor_department_count":"11"}'; $array = json_decode($json, true); $dcData = array(); $ebaData = array(); foreach($array as $row) { if($row['requestor_department'] == "DC") array_push($dcData, $row['requestor_department_count']; if($row['requestor_department'] == "EBA") array_push($ebaData, $row['requestor_department_count']; } echo json_encode($dcData); echo json_encode($ebaData); ?>

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.300.0090.03312.50
5.4.290.0050.03912.49
5.4.280.0090.03212.39
5.4.270.0060.03612.39
5.4.260.0030.04112.39
5.4.250.0080.03712.39
5.4.240.0020.04012.39
5.4.230.0050.03812.38
5.4.220.0080.03412.38
5.4.210.0040.03712.38
5.4.200.0080.03512.39
5.4.190.0080.03412.38
5.4.180.0080.03412.38
5.4.170.0040.03712.39
5.4.160.0090.03212.39
5.4.150.0050.03712.38
5.4.140.0090.04012.07
5.4.130.0060.03412.05
5.4.120.0070.03412.02
5.4.110.0040.03712.01
5.4.100.0080.03212.02
5.4.90.0070.03612.02
5.4.80.0030.04112.01
5.4.70.0060.03412.01
5.4.60.0080.03212.01
5.4.50.0090.03612.01
5.4.40.0090.04112.00
5.4.30.0050.03712.00
5.4.20.0030.03911.99
5.4.10.0080.03312.00
5.4.00.0060.04211.48
5.3.280.0090.03912.71
5.3.270.0030.04212.72
5.3.260.0030.04412.72
5.3.250.0120.03112.72
5.3.240.0080.03512.72
5.3.230.0080.04112.71
5.3.220.0040.03912.68
5.3.210.0040.04412.68
5.3.200.0090.03612.68
5.3.190.0050.04112.68
5.3.180.0100.03412.67
5.3.170.0090.04412.67
5.3.160.0060.04112.68
5.3.150.0080.04012.67
5.3.140.0070.03512.66
5.3.130.0070.04212.66
5.3.120.0130.03412.66
5.3.110.0090.03612.65
5.3.100.0030.04012.12
5.3.90.0100.03312.08
5.3.80.0090.03712.08
5.3.70.0080.03412.08
5.3.60.0080.03412.06
5.3.50.0030.03812.00
5.3.40.0100.03612.00
5.3.30.0110.03411.95
5.3.20.0030.03811.73
5.3.10.0060.03511.70
5.3.00.0060.04311.69

preferences:
139.94 ms | 1398 KiB | 7 Q