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); $new_holidays = []; foreach($response as $employee) { extract_holidays($employee, $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.60.0160.00316.50
8.3.50.0080.00622.05
8.3.40.0040.01118.84
8.3.30.0030.01019.34
8.3.20.0040.00420.04
8.3.10.0050.00323.66
8.3.00.0080.00018.98
8.2.180.0040.01116.32
8.2.170.0110.00422.96
8.2.160.0090.00620.52
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00226.16
8.2.120.0080.00020.94
8.2.110.0060.00322.11
8.2.100.0100.00017.78
8.2.90.0040.00419.21
8.2.80.0030.00617.97
8.2.70.0060.00317.63
8.2.60.0110.00517.53
8.2.50.0080.00018.07
8.2.40.0000.00821.25
8.2.30.0060.00318.32
8.2.20.0000.00817.63
8.2.10.0050.00218.05
8.2.00.0080.00017.82
8.1.280.0070.01125.92
8.1.270.0000.01623.91
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00323.96
8.1.230.0080.00418.98
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0040.00417.23
8.1.180.0090.00018.10
8.1.170.0000.00818.66
8.1.160.0000.00822.03
8.1.150.0060.00318.61
8.1.140.0040.00417.46
8.1.130.0070.00017.76
8.1.120.0000.00717.48
8.1.110.0040.00417.51
8.1.100.0000.00717.48
8.1.90.0040.00417.46
8.1.80.0050.00317.53
8.1.70.0030.00317.39
8.1.60.0040.00417.64
8.1.50.0000.00817.47
8.1.40.0000.00717.41
8.1.30.0060.00317.58
8.1.20.0040.00417.71
8.1.10.0040.00417.46
8.1.00.0070.00017.53
8.0.300.0030.00318.77
8.0.290.0000.00717.18
8.0.280.0070.00018.42
8.0.270.0030.00317.27
8.0.260.0030.00317.34
8.0.250.0030.00317.03
8.0.240.0040.00416.98
8.0.230.0030.00317.01
8.0.220.0030.00316.88
8.0.210.0080.00016.92
8.0.200.0020.00516.95
8.0.190.0000.00716.94
8.0.180.0000.00716.82
8.0.170.0080.00016.93
8.0.160.0000.00816.98
8.0.150.0030.00416.84
8.0.140.0030.00316.90
8.0.130.0000.00713.34
8.0.120.0030.00516.79
8.0.110.0000.00716.91
8.0.100.0050.00316.85
8.0.90.0040.00416.76
8.0.80.0090.00616.85
8.0.70.0000.00816.82
8.0.60.0040.00416.73
8.0.50.0000.00716.90
8.0.30.0090.01216.97
8.0.20.0140.01217.40
8.0.10.0050.00216.88
8.0.00.0040.01316.87
7.4.330.0020.00215.00
7.4.320.0030.00316.42
7.4.300.0000.00716.46
7.4.290.0040.00416.44
7.4.280.0040.00416.61
7.4.270.0000.00716.50
7.4.260.0040.00416.48
7.4.250.0070.00016.43
7.4.240.0020.00516.63
7.4.230.0040.00416.59
7.4.220.0080.01116.66
7.4.210.0070.00916.55
7.4.200.0040.00416.26
7.4.190.0070.00016.78
7.4.160.0140.00416.51
7.4.150.0000.01717.40
7.4.140.0140.00417.86
7.4.130.0070.01016.52
7.4.120.0110.00916.46
7.4.110.0090.01016.41
7.4.100.0100.00716.54
7.4.90.0100.01016.56
7.4.80.0070.01319.39
7.4.70.0130.00716.41
7.4.60.0130.00416.42
7.4.50.0000.00816.44
7.4.40.0070.01016.41
7.4.30.0180.00016.73
7.4.00.0080.00814.71
7.3.330.0030.00313.23
7.3.320.0000.00513.38
7.3.310.0030.00316.23
7.3.300.0050.00216.25
7.3.290.0070.00716.38
7.3.280.0070.01016.31
7.3.270.0060.01117.40
7.3.260.0120.01316.63
7.3.250.0130.00516.47
7.3.240.0100.01416.52
7.3.230.0100.00616.39
7.3.210.0150.00316.42
7.3.200.0060.01319.39
7.3.190.0080.00816.30
7.3.180.0090.00916.49
7.3.170.0030.01316.35
7.3.160.0130.00316.37
7.3.120.0030.01315.01
7.2.330.0090.01516.71
7.2.320.0030.01416.68
7.2.310.0130.01016.82
7.2.300.0070.01016.78
7.2.290.0090.00916.45
7.2.60.0150.00016.84
7.1.200.0160.00315.59
7.1.70.0030.00617.18
7.1.60.0030.02119.46
7.1.50.0070.00317.14
7.1.00.0070.07322.35
7.0.200.0040.00816.93
7.0.140.0070.07022.04
7.0.90.0430.03720.05
7.0.80.0600.04020.03
7.0.70.0500.04320.00
7.0.60.0570.04319.99
7.0.50.0470.05720.34
7.0.40.0130.06720.03
7.0.30.0030.09020.12
7.0.20.0130.07320.04
7.0.10.0130.07020.09
7.0.00.0070.08320.13
5.6.280.0100.06321.13
5.6.240.0030.05020.73
5.6.230.0130.04320.49
5.6.220.0030.08020.59
5.6.210.0070.07720.50
5.6.200.0200.04321.09
5.6.190.0070.07721.11
5.6.180.0070.04721.01
5.6.170.0030.08021.09
5.6.160.0070.04321.04
5.6.150.0100.07321.03
5.6.140.0070.08021.03
5.6.130.0070.08021.09
5.6.120.0070.08721.08
5.6.110.0100.08021.11
5.6.100.0070.08321.03
5.6.90.0200.06020.95
5.6.80.0030.07720.51
5.6.70.0100.06720.56
5.6.60.0100.08020.49
5.6.50.0070.05320.47
5.6.40.0000.08720.39
5.6.30.0030.05020.54
5.6.20.0100.07320.29
5.6.10.0100.04020.43
5.6.00.0070.06320.23
5.5.380.0070.04720.55
5.5.370.0000.04720.55
5.5.360.0130.07320.38
5.5.350.0170.06720.43
5.5.340.0170.04720.84
5.5.330.0030.07720.80
5.5.320.0070.06020.78
5.5.310.0100.07720.91
5.5.300.0100.07320.88
5.5.290.0100.04020.90
5.5.280.0070.08720.83
5.5.270.0130.06320.64
5.5.260.0000.05720.90
5.5.250.0170.07320.72
5.5.240.0130.07020.25
5.5.230.0070.06720.25
5.5.220.0030.07020.16
5.5.210.0130.07320.30
5.5.200.0170.06720.17
5.5.190.0100.05720.09
5.5.180.0070.03720.25
5.5.160.0030.08020.13
5.5.150.0030.08720.20
5.5.140.0070.04720.24
5.5.130.0200.06020.21
5.5.120.0070.04020.11
5.5.110.0070.04020.11
5.5.100.0030.04019.96
5.5.90.0070.03720.10
5.5.80.0070.04019.95
5.5.70.0070.03720.07
5.5.60.0070.04720.07
5.5.50.0030.04020.11
5.5.40.0070.03320.08
5.5.30.0030.04020.06
5.5.20.0030.04020.01
5.5.10.0030.03719.98
5.5.00.0000.04020.06
5.4.450.0100.06719.50
5.4.440.0030.06019.35
5.4.430.0030.08319.53
5.4.420.0030.08019.27
5.4.410.0070.04319.04
5.4.400.0070.06019.24
5.4.390.0070.05319.18
5.4.380.0070.05319.16
5.4.370.0030.05019.04
5.4.360.0100.06019.13
5.4.350.0030.06718.90
5.4.340.0030.05318.85
5.4.320.0000.07019.23
5.4.310.0070.05018.87
5.4.300.0170.05719.16
5.4.290.0030.04719.20
5.4.280.0070.03718.85
5.4.270.0130.06019.23
5.4.260.0100.03319.12
5.4.250.0030.03719.13
5.4.240.0030.03719.11
5.4.230.0030.03719.04
5.4.220.0030.03719.04
5.4.210.0030.03718.84
5.4.200.0070.03718.90
5.4.190.0000.05018.93
5.4.180.0030.03319.18
5.4.170.0030.03719.13
5.4.160.0030.03719.07
5.4.150.0030.04718.86
5.4.140.0000.04016.29
5.4.130.0000.06716.37
5.4.120.0030.03316.21
5.4.110.0070.05316.38
5.4.100.0000.03716.53
5.4.90.0070.03316.38
5.4.80.0100.06016.46
5.4.70.0000.04016.47
5.4.60.0030.03316.50
5.4.50.0070.04016.50
5.4.40.0070.06716.43
5.4.30.0000.04016.37
5.4.20.0070.03016.42
5.4.10.0000.04016.47
5.4.00.0100.06315.80
5.3.290.0030.05314.64
5.3.280.0030.03714.73
5.3.270.0000.03714.74
5.3.260.0030.03714.70
5.3.250.0030.03714.60
5.3.240.0030.03714.67
5.3.230.0000.04314.52
5.3.220.0030.03714.63
5.3.210.0070.03314.57
5.3.200.0030.03314.50
5.3.190.0070.03314.62
5.3.180.0000.04014.64
5.3.170.0070.03314.63
5.3.160.0070.03314.56
5.3.150.0000.03714.60
5.3.140.0030.03314.68
5.3.130.0000.03714.62
5.3.120.0030.05014.54
5.3.110.0000.04014.60
5.3.100.0070.03313.97
5.3.90.0000.06714.07
5.3.80.0070.05314.04
5.3.70.0000.04014.16
5.3.60.0030.03714.12
5.3.50.0170.03013.94
5.3.40.0000.04013.93
5.3.30.0070.03313.91
5.3.20.0000.03713.64
5.3.10.0070.03013.66
5.3.00.0030.03013.65
5.2.170.0000.03011.07
5.2.160.0100.02011.07
5.2.150.0030.02711.13
5.2.140.0030.02711.24
5.2.130.0000.03011.03
5.2.120.0000.03011.03
5.2.110.0070.06311.03
5.2.100.0000.03011.04
5.2.90.0000.02711.01
5.2.80.0000.03311.08
5.2.70.0030.03011.11
5.2.60.0030.06311.05
5.2.50.0070.06010.90
5.2.40.0070.04710.85
5.2.30.0000.04711.02
5.2.20.0030.06711.05
5.2.10.0000.04310.78
5.2.00.0070.03310.66
5.1.60.0030.03010.08
5.1.50.0030.05310.00
5.1.40.0100.0479.81
5.1.30.0000.06010.40
5.1.20.0070.05010.41
5.1.10.0070.05710.16
5.1.00.0070.04010.06
5.0.50.0030.0438.38
5.0.40.0000.0478.52
5.0.30.0070.0638.21
5.0.20.0100.0308.25
5.0.10.0070.0238.20
5.0.00.0000.0438.19
4.4.90.0000.0177.27
4.4.80.0030.0307.27
4.4.70.0000.0207.27
4.4.60.0000.0237.27
4.4.50.0030.0237.27
4.4.40.0000.0277.27
4.4.30.0030.0207.27
4.4.20.0000.0377.27
4.4.10.0030.0207.27
4.4.00.0000.0607.27
4.3.110.0030.0337.27
4.3.100.0030.0207.27
4.3.90.0000.0207.27
4.3.80.0000.0507.27
4.3.70.0030.0337.27
4.3.60.0070.0307.27
4.3.50.0000.0277.27
4.3.40.0030.0307.27
4.3.30.0070.0277.27
4.3.20.0030.0337.27
4.3.10.0030.0307.27
4.3.00.0000.0307.27

preferences:
39.17 ms | 401 KiB | 5 Q