3v4l.org

run code in 300+ PHP versions simultaneously
<?php function japan_holiday_ics() { // カレンダーID $calendar_id = urlencode('japanese__ja@holiday.calendar.google.com'); $url = 'https://calendar.google.com/calendar/ical/'.$calendar_id.'/public/full.ics'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); curl_close($ch); if (!empty($result)) { $items = $sort = array(); $start = false; $count = 0; foreach(explode("\n", $result) as $row => $line) { // 1行目が「BEGIN:VCALENDAR」でなければ終了 if (0 === $row && false === stristr($line, 'BEGIN:VCALENDAR')) { break; } // 改行などを削除 $line = trim($line); // 「BEGIN:VEVENT」なら日付データの開始 if (false !== stristr($line, 'BEGIN:VEVENT')) { $start = true; } elseif ($start) { // 「END:VEVENT」なら日付データの終了 if (false !== stristr($line, 'END:VEVENT')) { $start = false; // 次のデータ用にカウントを追加 ++$count; } else { // 配列がなければ作成 if (empty($items[$count])) { $items[$count] = array('date' => null, 'title' => null); } // 「DTSTART;~」(対象日)の処理 if(0 === strpos($line, 'DTSTART;VALUE')) { $date = explode(':', $line); $date = end($date); $items[$count]['date'] = $date; // ソート用の配列にセット $sort[$count] = $date; } // 「SUMMARY:~」(名称)の処理 elseif(0 === strpos($line, 'SUMMARY:')) { list($title) = explode('/', substr($line, 8)); $items[$count]['title'] = trim($title); } } } } // 日付でソート $items = array_combine($sort, $items); ksort($items); return $items; } }

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.0130.00316.50
8.3.60.0200.00018.30
8.3.50.0150.00521.25
8.3.40.0070.00718.56
8.3.30.0110.00718.44
8.3.20.0080.00020.38
8.3.10.0070.00021.86
8.3.00.0040.00423.53
8.2.190.0090.01218.00
8.2.180.0000.01518.29
8.2.170.0110.00722.96
8.2.160.0070.01020.35
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00819.70
8.2.120.0080.00026.35
8.2.110.0040.00422.24
8.2.100.0000.01117.91
8.2.90.0080.00019.09
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0040.00417.93
8.2.50.0070.00418.07
8.2.40.0030.00522.16
8.2.30.0040.00419.36
8.2.20.0000.00717.58
8.2.10.0040.00417.89
8.2.00.0060.00317.84
8.1.280.0160.00625.92
8.1.270.0000.00822.18
8.1.260.0000.00928.09
8.1.250.0030.00528.09
8.1.240.0090.00023.93
8.1.230.0040.00719.17
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0000.01217.22
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0040.00418.57
8.1.160.0030.00620.71
8.1.150.0000.00718.71
8.1.140.0040.00419.39
8.1.130.0000.00717.61
8.1.120.0050.00217.28
8.1.110.0030.00517.25
8.1.100.0060.00317.26
8.1.90.0030.00517.35
8.1.80.0040.00417.44
8.1.70.0070.00017.29
8.1.60.0040.00417.50
8.1.50.0050.00517.46
8.1.40.0040.00417.30
8.1.30.0000.00817.54
8.1.20.0040.00417.53
8.1.10.0050.00217.42
8.1.00.0000.00817.32
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0070.00018.27
8.0.270.0070.00017.15
8.0.260.0030.00317.16
8.0.250.0030.00316.84
8.0.240.0000.00716.75
8.0.230.0030.00316.75
8.0.220.0030.00316.69
8.0.210.0040.00416.76
8.0.200.0060.00316.89
8.0.190.0030.00616.90
8.0.180.0000.00716.71
8.0.170.0040.00416.79
8.0.160.0040.00416.85
8.0.150.0000.00716.75
8.0.140.0040.00416.74
8.0.130.0060.00013.21
8.0.120.0030.00516.80
8.0.110.0040.00416.70
8.0.100.0050.00216.69
8.0.90.0070.00016.69
8.0.80.0070.01116.75
8.0.70.0000.00716.79
8.0.60.0100.00016.79
8.0.50.0000.00816.79
8.0.30.0090.00717.11
8.0.20.0080.01217.40
8.0.10.0000.00716.87
8.0.00.0120.01016.69
7.4.330.0030.00316.77
7.4.320.0040.00416.44
7.4.300.0030.00316.43
7.4.290.0000.00616.50
7.4.280.0030.00616.39
7.4.270.0070.00016.42
7.4.260.0040.00416.35
7.4.250.0030.00316.37
7.4.240.0020.00616.39
7.4.230.0040.00416.52
7.4.220.0040.01216.40
7.4.210.0090.00516.52
7.4.200.0000.00716.41
7.4.160.0120.00816.23
7.4.150.0110.00717.40
7.4.140.0060.01217.86
7.4.130.0100.01116.41
7.4.120.0090.00816.49
7.4.110.0070.01016.50
7.4.100.0120.01216.34
7.4.90.0090.00916.33
7.4.80.0120.00619.39
7.4.70.0090.00616.54
7.4.60.0070.01116.41
7.4.50.0120.00616.33
7.4.40.0130.00616.52
7.4.30.0100.00716.51
7.4.10.0150.00115.65
7.4.00.0020.01215.46
7.3.330.0030.00313.05
7.3.320.0060.00013.16
7.3.310.0030.00316.11
7.3.300.0030.00316.22
7.3.290.0000.00716.08
7.3.280.0070.01116.18
7.3.270.0130.01017.40
7.3.260.0100.00916.16
7.3.250.0080.00916.28
7.3.240.0040.01316.22
7.3.230.0150.00916.39
7.3.210.0040.01516.20
7.3.200.0030.01319.39
7.3.190.0090.00716.26
7.3.180.0090.00616.09
7.3.170.0090.00616.27
7.3.160.0120.00416.36
7.3.130.0070.00915.66
7.3.120.0050.01115.49
7.3.110.0100.00715.61
7.3.100.0020.01315.45
7.3.90.0090.00515.46
7.3.80.0050.00815.44
7.3.70.0110.00015.40
7.3.60.0000.01215.47
7.3.50.0060.01015.47
7.3.40.0040.01015.43
7.3.30.0050.00515.40
7.3.20.0050.00817.42
7.3.10.0090.00717.25
7.3.00.0040.00617.30
7.2.330.0180.00716.52
7.2.320.0090.00916.22
7.2.310.0040.01416.37
7.2.300.0090.00916.66
7.2.290.0030.01416.54
7.2.260.0090.00915.66
7.2.250.0070.01115.54
7.2.240.0090.00715.73
7.2.230.0030.01115.76
7.2.220.0070.00815.64
7.2.210.0030.01015.62
7.2.200.0050.00615.51
7.2.190.0020.01015.59
7.2.180.0090.00515.50
7.2.170.0030.01315.52
7.2.160.0080.00815.63
7.2.150.0060.01017.46
7.2.140.0070.00717.51
7.2.130.0020.01017.34
7.2.120.0030.00917.47
7.2.110.0000.01117.56
7.2.100.0050.01017.38
7.2.90.0050.00717.51
7.2.80.0080.00717.61
7.2.70.0100.00317.41
7.2.60.0090.00417.44
7.2.50.0080.00517.42
7.2.40.0100.00417.54
7.2.30.0070.00917.45
7.2.20.0060.00817.33
7.2.10.0060.00817.40
7.2.00.0060.00818.04
7.1.330.0050.00816.60
7.1.320.0070.00616.38
7.1.310.0050.00816.38
7.1.300.0020.00716.38
7.1.290.0000.01116.17
7.1.280.0040.00916.36
7.1.270.0090.00416.29
7.1.260.0040.00716.24
7.1.250.0060.00616.24
7.1.240.0040.00616.37
7.1.230.0030.00816.30
7.1.220.0040.01216.45
7.1.210.0060.00516.24
7.1.200.0060.00916.28
7.1.190.0070.00416.24
7.1.180.0060.00416.32
7.1.170.0070.00716.31
7.1.160.0030.00616.36
7.1.150.0050.00916.11
7.1.140.0060.00616.26
7.1.130.0040.00516.31
7.1.120.0050.01016.41
7.1.110.0060.00616.44
7.1.100.0060.00616.79
7.1.90.0090.00516.34
7.1.80.0060.00716.38
7.1.70.0040.00716.50
7.1.60.0070.01017.38
7.1.50.0060.00816.54
7.1.40.0010.00816.13
7.1.30.0060.00616.33
7.1.20.0030.00916.40
7.1.10.0050.00816.38
7.1.00.0010.03318.30
7.0.330.0070.00716.01
7.0.320.0050.00816.09
7.0.310.0030.00916.01
7.0.300.0050.01116.02
7.0.290.0020.00916.10
7.0.280.0020.01116.05
7.0.270.0050.00815.94
7.0.260.0030.00915.99
7.0.250.0080.00815.93
7.0.240.0100.00216.12
7.0.230.0060.00616.06
7.0.220.0070.00516.10
7.0.210.0050.00916.06
7.0.200.0080.00516.27
7.0.190.0070.00416.17
7.0.180.0050.00815.95
7.0.170.0020.01316.21
7.0.160.0050.00716.09
7.0.150.0030.01215.99
7.0.140.0050.00616.03
7.0.130.0060.00616.09
7.0.120.0000.01116.06
7.0.110.0030.00816.15
7.0.100.0070.00716.10
7.0.90.0060.00716.01
7.0.80.0050.00715.87
7.0.70.0040.00516.06
7.0.60.0120.02817.90
7.0.50.0030.02216.58
7.0.40.0020.02215.96
7.0.30.0150.02816.10
7.0.20.0140.02915.99
7.0.10.0070.03416.00
7.0.00.0090.03016.11
5.6.400.0040.00914.97
5.6.390.0050.00814.99
5.6.380.0050.00714.96
5.6.370.0040.00914.97
5.6.360.0090.00614.87
5.6.350.0030.01015.01
5.6.340.0020.01115.11
5.6.330.0050.00815.03
5.6.320.0030.00714.80
5.6.310.0070.00914.78
5.6.300.0030.01015.06
5.6.290.0050.00814.78
5.6.280.0060.01717.05
5.6.270.0070.00714.85
5.6.260.0030.01214.88
5.6.250.0060.00514.85
5.6.240.0060.00815.08
5.6.230.0050.01014.94
5.6.220.0040.00914.84
5.6.210.0030.02316.78
5.6.200.0070.01916.07
5.6.190.0090.03016.85
5.6.180.0100.02216.71
5.6.170.0090.01716.81
5.6.160.0120.02716.70
5.6.150.0080.03216.03
5.6.140.0140.02616.11
5.6.130.0060.03216.06
5.6.120.0080.02916.98
5.6.110.0020.02216.99
5.6.100.0050.03516.98
5.6.90.0080.02716.94
5.6.80.0080.03116.65
5.6.70.0040.00914.93
5.6.60.0120.00314.95
5.6.50.0100.00614.90
5.6.40.0070.00714.77
5.6.30.0100.00614.79
5.6.20.0110.00414.88
5.6.10.0040.00714.75
5.6.00.0040.01214.82
5.5.380.0050.00914.96
5.5.370.0020.00914.77
5.5.360.0050.00814.96
5.5.350.0040.02116.56
5.5.340.0060.03415.87
5.5.330.0040.02216.74
5.5.320.0240.02916.54
5.5.310.0100.02016.79
5.5.300.0060.02815.79
5.5.290.0060.01615.82
5.5.280.0070.02316.72
5.5.270.0090.02516.79
5.5.260.0080.01816.84
5.5.250.0070.03116.66
5.5.240.0120.01616.64
5.5.230.0060.00514.84
5.5.220.0060.00614.65
5.5.210.0060.01014.87
5.5.200.0090.00514.87
5.5.190.0070.00714.78
5.5.180.0000.01214.53
5.5.170.0100.00314.73
5.5.160.0060.00814.60
5.5.150.0050.00614.89
5.5.140.0030.00914.85
5.5.130.0030.00914.62
5.5.120.0050.01114.76
5.5.110.0080.00714.70
5.5.100.0080.00814.70
5.5.90.0030.01014.75
5.5.80.0000.01014.62
5.5.70.0040.00614.88
5.5.60.0070.00714.68
5.5.50.0050.01014.70
5.5.40.0060.00814.70
5.5.30.0030.01314.59
5.5.20.0040.00814.62
5.5.10.0040.00814.84
5.5.00.0020.00914.66

preferences:
16.83 ms | 401 KiB | 5 Q