3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extract_holidays($employee /* Array */, $new_holidays /* Array */) { $new_holidays[] = [ "name" => $employee["firstname"].' '.$employee["lastname"], "startDate" => '2014-01-01', "endDate" => '2014-01-07' ]; } $response = json_decode('[{"firstname":"system","lastname":"system","id_employee":"24040","schedule":{"2014-07-01":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]},"2014-07-02":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]},"2014-07-03":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]},"2014-07-04":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]},"2014-07-05":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]},"2014-07-06":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]},"2014-07-07":{"text":"OFF","id_event":"22","event_name":"off","color":"AAAAAA","is_work":false,"details":[]}}},{"firstname":"amira","lastname":"turki","id_employee":"28472","schedule":{"2014-07-01":{"text":"7h30-17h","id_event":"1","event_name":"planifi\u00e9","color":"FFFFFF","is_work":true,"details":[{"event_name":"planifi\u00e9","id_event":"1","is_work":"1","start":1404192600,"end":1404226800}]},"2014-07-02":{"text":"7h30-17h","id_event":"1","event_name":"planifi\u00e9","color":"FFFFFF","is_work":true,"details":[{"event_name":"planifi\u00e9","id_event":"1","is_work":"1","start":1404279000,"end":1404313200}]},"2014-07-03":{"text":"7h30-17h","id_event":"1","event_name":"planifi\u00e9","color":"FFFFFF","is_work":true,"details":[{"event_name":"planifi\u00e9","id_event":"1","is_work":"1","start":1404365400,"end":1404399600}]},"2014-07-04":{"text":"7h30-17h","id_event":"1","event_name":"planifi\u00e9","color":"FFFFFF","is_work":true,"details":[{"event_name":"planifi\u00e9","id_event":"1","is_work":"1","start":1404451800,"end":1404486000}]},"2014-07-05":{"text":"REPOS","id_event":"20","event_name":"repos","color":"FFFFAA","is_work":false,"details":[]},"2014-07-06":{"text":"REPOS","id_event":"20","event_name":"repos","color":"FFFFAA","is_work":false,"details":[]},"2014-07-07":{"text":"7h30-17h","id_event":"1","event_name":"planifi\u00e9","color":"FFFFFF","is_work":true,"details":[{"event_name":"planifi\u00e9","id_event":"1","is_work":"1","start":1404711000,"end":1404745200}]}}}]',true); var_dump($response); $new_holidays = []; foreach($response as $employee) { extract_holidays($employee, $new_holidays); } var_dump($new_holidays); // echo json_encode($new_holidays,true);

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.70.0060.01018.29
8.3.60.0100.01016.50
8.3.50.0120.00922.05
8.3.40.0140.00318.79
8.3.30.0060.00919.00
8.3.20.0080.00020.31
8.3.10.0040.00423.59
8.3.00.0060.00319.20
8.2.180.0100.00716.63
8.2.170.0130.00322.96
8.2.160.0090.00620.26
8.2.150.0060.00324.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0090.00020.73
8.2.110.0100.00022.14
8.2.100.0090.00317.84
8.2.90.0080.00019.40
8.2.80.0000.00817.97
8.2.70.0050.00517.63
8.2.60.0030.00618.04
8.2.50.0030.00618.07
8.2.40.0000.00821.10
8.2.30.0050.00518.31
8.2.20.0040.00417.63
8.2.10.0040.00418.14
8.2.00.0080.00017.71
8.1.280.0030.01325.92
8.1.270.0060.00323.88
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00323.73
8.1.230.0090.00318.95
8.1.220.0080.00017.74
8.1.210.0090.00018.77
8.1.200.0030.00717.35
8.1.190.0000.00817.23
8.1.180.0050.00318.10
8.1.170.0040.00418.70
8.1.160.0040.00422.02
8.1.150.0050.00318.53
8.1.140.0040.00417.38
8.1.130.0040.00417.82
8.1.120.0040.00417.44
8.1.110.0050.00217.37
8.1.100.0000.00817.35
8.1.90.0080.00017.48
8.1.80.0060.00317.38
8.1.70.0000.00817.48
8.1.60.0040.00417.48
8.1.50.0040.00417.46
8.1.40.0030.00517.45
8.1.30.0030.00617.62
8.1.20.0030.00517.68
8.1.10.0050.00317.43
8.1.00.0030.00617.51
8.0.300.0080.00018.77
8.0.290.0000.00717.16
8.0.280.0070.00018.33
8.0.270.0040.00417.33
8.0.260.0000.00717.13
8.0.250.0030.00317.03
8.0.240.0030.00617.03
8.0.230.0000.00716.86
8.0.220.0040.00416.85
8.0.210.0070.00016.81
8.0.200.0000.00717.03
8.0.190.0080.00016.98
8.0.180.0040.00416.92
8.0.170.0000.00816.81
8.0.160.0040.00416.89
8.0.150.0030.00516.88
8.0.140.0070.00316.88
8.0.130.0000.00713.29
8.0.120.0000.00816.86
8.0.110.0080.00016.88
8.0.100.0050.00316.75
8.0.90.0040.00416.79
8.0.80.0130.01016.79
8.0.70.0000.00816.77
8.0.60.0060.00316.68
8.0.50.0000.00817.00
8.0.30.0090.01317.15
8.0.20.0160.00917.40
8.0.10.0050.00317.04
8.0.00.0160.00516.82
7.4.330.0000.00515.09
7.4.320.0040.00416.50
7.4.300.0050.00316.61
7.4.290.0080.00016.66
7.4.280.0040.00416.50
7.4.270.0040.00416.66
7.4.260.0040.00416.57
7.4.250.0080.00016.44
7.4.240.0040.00416.54
7.4.230.0030.00616.48
7.4.220.0070.01316.62
7.4.210.0050.01116.59
7.4.200.0040.00416.61
7.4.190.0050.00316.34
7.4.160.0080.01216.76
7.4.150.0150.00817.40
7.4.140.0180.00417.86
7.4.130.0170.00416.50
7.4.120.0110.00916.43
7.4.110.0110.00916.52
7.4.100.0150.01216.52
7.4.90.0090.01216.62
7.4.80.0100.01019.39
7.4.70.0120.00916.58
7.4.60.0180.00316.73
7.4.50.0060.00316.46
7.4.40.0070.01116.41
7.4.30.0100.01016.57
7.4.00.0000.01515.02
7.3.330.0000.00713.23
7.3.320.0030.00313.13
7.3.310.0040.00416.42
7.3.300.0070.00016.27
7.3.290.0060.01516.30
7.3.280.0120.00916.28
7.3.270.0160.00317.40
7.3.260.0170.01216.34
7.3.250.0170.00816.48
7.3.240.0220.00316.52
7.3.230.0210.00016.39
7.3.210.0220.00716.36
7.3.200.0110.00819.39
7.3.190.0140.01116.43
7.3.180.0090.00916.65
7.3.170.0160.00316.50
7.3.160.0190.00016.33
7.3.120.0060.00915.01
7.3.10.0110.00616.88
7.3.00.0100.00316.63
7.2.330.0000.02216.52
7.2.320.0060.01316.46
7.2.310.0100.01016.55
7.2.300.0100.01016.80
7.2.290.0180.00416.66
7.2.130.0070.00716.91
7.2.120.0100.00616.94
7.2.110.0060.00916.98
7.2.100.0070.00716.73
7.2.90.0030.01317.04
7.2.80.0060.00616.93
7.2.70.0070.00716.54
7.2.60.0090.00516.94
7.2.50.0090.00316.99
7.2.40.0040.00716.99
7.2.30.0090.00616.99
7.2.20.0070.00716.80
7.2.10.0000.01816.90
7.2.00.0140.00016.62
7.1.250.0060.00615.42
7.1.200.0080.00815.67
7.1.100.0030.01218.16
7.1.70.0000.00917.34
7.1.60.0160.01019.46
7.1.50.0070.00416.90
7.1.00.0070.06722.35
7.0.200.0100.00316.67
7.0.140.0070.07322.04
7.0.60.0070.04019.95
7.0.50.0070.06717.89
7.0.40.0070.07320.02
7.0.30.0330.06020.20
7.0.20.0370.07020.10
7.0.10.0130.08020.12
7.0.00.0130.08320.12
5.6.280.0000.07320.93
5.6.210.0070.08020.70
5.6.200.0100.07018.18
5.6.190.0100.04320.47
5.6.180.0200.05020.42
5.6.170.0300.07720.50
5.6.160.0100.08020.46
5.6.150.0100.07318.16
5.6.140.0030.04018.23
5.6.130.0200.07318.23
5.6.120.0100.08321.00
5.6.110.0130.08321.01
5.6.100.0130.07721.00
5.6.90.0030.06321.03
5.6.80.0100.05720.54
5.5.350.3070.03320.49
5.5.340.0030.09017.98
5.5.330.0070.06320.57
5.5.320.0330.08320.27
5.5.310.0030.09020.38
5.5.300.0100.06017.98
5.5.290.0030.08317.98
5.5.280.0100.08020.70
5.5.270.0000.05020.73
5.5.260.0000.04720.90
5.5.250.0030.06720.55
5.5.240.0000.08020.11
5.4.450.0330.04023.78
5.4.440.0230.05020.77
5.4.430.0400.03719.47
5.4.420.0130.04019.48
5.4.410.0200.03019.06
5.4.400.0270.04019.17
5.4.390.0370.03319.16
5.4.380.0100.06318.78
5.4.370.0170.06718.78
5.4.360.0000.06318.57
5.4.350.0170.05718.78
5.4.340.0170.05318.65
5.4.320.0060.03912.54
5.4.310.0080.03812.53
5.4.300.0110.03912.54
5.4.290.0110.03712.53
5.4.280.0110.04412.43
5.4.270.0200.04012.43
5.4.260.0100.04912.43
5.4.250.0090.04012.43
5.4.240.0070.04012.43
5.4.230.0090.03912.43
5.4.220.0050.04112.42
5.4.210.0100.05212.43
5.4.200.0090.05412.43
5.4.190.0080.05412.42
5.4.180.0110.05212.42
5.4.170.0100.05012.42
5.4.160.0100.04412.42
5.4.150.0110.03912.42
5.4.140.0090.04312.10
5.4.130.0050.04012.09
5.4.120.0090.03912.05
5.4.110.0080.04112.05
5.4.100.0110.03612.04
5.4.90.0060.05012.04
5.4.80.0090.03812.04
5.4.70.0050.04412.04
5.4.60.0080.03912.04
5.4.50.0100.03812.04
5.4.40.0100.03712.03
5.4.30.0090.03612.03
5.4.20.0090.03812.03
5.4.10.0070.04012.02
5.4.00.0130.04311.52
5.3.290.0080.03612.80
5.3.280.0090.05812.71
5.3.270.0090.04912.72
5.3.260.0080.04312.72
5.3.250.0020.04512.72
5.3.240.0050.04312.72
5.3.230.0080.04012.71
5.3.220.0050.04012.68
5.3.210.0100.04212.68
5.3.200.0060.04112.68
5.3.190.0050.04112.68
5.3.180.0030.04212.67
5.3.170.0070.04312.66
5.3.160.0100.04412.67
5.3.150.0090.04912.68
5.3.140.0070.04912.66
5.3.130.0080.05612.66
5.3.120.0060.05312.66
5.3.110.0090.05012.66
5.3.100.0050.04812.13
5.3.90.0080.04812.11
5.3.80.0070.04712.09
5.3.70.0080.04612.09
5.3.60.0080.04412.09
5.3.50.0060.04912.02
5.3.40.0070.04512.02
5.3.30.0100.04611.98
5.3.20.0060.03811.77
5.3.10.0050.03511.73
5.3.00.0070.03411.72
5.2.170.0040.0339.22
5.2.160.0080.0259.22
5.2.150.0040.0329.22
5.2.140.0050.0319.22
5.2.130.0020.0319.18
5.2.120.0060.0289.18
5.2.110.0030.0339.18
5.2.100.0030.0319.18
5.2.90.0060.0299.18
5.2.80.0040.0339.18
5.2.70.0070.0299.17
5.2.60.0040.0309.13
5.2.50.0070.0309.10
5.2.40.0030.0369.07
5.2.30.0090.0399.05
5.2.20.0030.0329.04
5.2.10.0040.0328.96
5.2.00.0060.0358.81
5.1.60.0040.0328.10
5.1.50.0040.0328.09
5.1.40.0060.0258.07
5.1.30.0060.0278.42
5.1.20.0030.0318.45
5.1.10.0080.0338.17
5.1.00.0090.0338.17
5.0.50.0010.0306.65
5.0.40.0070.0226.50
5.0.30.0050.0336.32
5.0.20.0050.0206.29
5.0.10.0090.0206.26
5.0.00.0030.0326.25
4.4.90.0020.0224.78
4.4.80.0040.0214.75
4.4.70.0020.0204.76
4.4.60.0040.0204.75
4.4.50.0020.0224.77
4.4.40.0040.0334.70
4.4.30.0050.0214.75
4.4.20.0020.0234.84
4.4.10.0030.0214.85
4.4.00.0050.0314.76
4.3.110.0060.0214.67
4.3.100.0030.0224.67
4.3.90.0040.0194.63
4.3.80.0050.0314.58
4.3.70.0030.0204.63
4.3.60.0040.0204.62
4.3.50.0020.0234.63
4.3.40.0080.0194.54
4.3.30.0010.0173.30
4.3.20.0020.0163.28
4.3.10.0020.0163.24
4.3.00.0070.01315.09

preferences:
46.77 ms | 401 KiB | 5 Q