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; } } japan_holiday_ics();

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.0070.00716.75
8.3.50.0120.01021.19
8.3.40.0040.01118.90
8.3.30.0040.01118.69
8.3.20.0050.00320.14
8.3.10.0040.00421.73
8.3.00.0050.00323.54
8.2.180.0130.01018.41
8.2.170.0070.00719.09
8.2.160.0120.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0000.00819.60
8.2.120.0040.00426.35
8.2.110.0090.00022.24
8.2.100.0000.01117.80
8.2.90.0050.00319.13
8.2.80.0000.00818.04
8.2.70.0030.00617.63
8.2.60.0050.00317.80
8.2.50.0040.00718.07
8.2.40.0040.00422.32
8.2.30.0040.00419.48
8.2.20.0040.00417.78
8.2.10.0050.00318.11
8.2.00.0000.00818.10
8.1.280.0140.00725.92
8.1.270.0030.00522.19
8.1.260.0090.00028.09
8.1.250.0000.00828.09
8.1.240.0000.00923.86
8.1.230.0030.00719.13
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0000.00917.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00818.65
8.1.160.0020.00520.75
8.1.150.0000.00718.79
8.1.140.0000.00819.57
8.1.130.0030.00317.61
8.1.120.0040.00417.50
8.1.110.0050.00217.46
8.1.100.0040.00417.46
8.1.90.0050.00317.46
8.1.80.0000.00717.46
8.1.70.0080.00017.34
8.1.60.0000.00917.66
8.1.50.0040.00417.62
8.1.40.0060.00317.43
8.1.30.0060.00317.73
8.1.20.0030.00617.77
8.1.10.0040.00417.67
8.1.00.0040.00417.55
8.0.300.0030.00618.77
8.0.290.0050.00316.75
8.0.280.0030.00318.41
8.0.270.0070.00017.22
8.0.260.0000.00717.31
8.0.250.0030.00517.10
8.0.240.0070.00016.97
8.0.230.0000.00817.09
8.0.220.0000.00816.97
8.0.210.0040.00416.98
8.0.200.0030.00317.02
8.0.190.0040.00417.05
8.0.180.0040.00416.92
8.0.170.0030.00517.00
8.0.160.0000.00716.91
8.0.150.0040.00416.89
8.0.140.0030.00516.89
8.0.130.0030.00313.38
8.0.120.0030.00616.92
8.0.110.0000.00916.96
8.0.100.0050.00316.98
8.0.90.0000.00717.02
8.0.80.0150.00016.93
8.0.70.0030.00516.86
8.0.60.0040.00416.97
8.0.50.0030.00617.04
8.0.30.0090.00917.24
8.0.20.0070.01417.40
8.0.10.0000.00716.95
8.0.00.0160.00616.78
7.4.330.0000.00516.82
7.4.320.0070.00016.62
7.4.300.0040.00416.55
7.4.290.0070.00016.61
7.4.280.0000.00916.53
7.4.270.0000.00716.60
7.4.260.0030.00316.54
7.4.250.0070.00016.57
7.4.240.0070.00016.69
7.4.230.0030.00316.52
7.4.220.0050.00216.73
7.4.210.0070.00816.52
7.4.200.0040.00416.58
7.4.160.0140.00316.61
7.4.150.0090.00917.40
7.4.140.0070.01217.86
7.4.130.0060.01216.67
7.4.120.0030.01516.60
7.4.110.0120.00616.57
7.4.100.0100.01016.45
7.4.90.0130.00616.45
7.4.80.0030.01319.39
7.4.70.0030.01516.51
7.4.60.0060.01216.47
7.4.50.0060.00616.55
7.4.40.0030.01316.68
7.4.30.0130.00316.46
7.4.00.0060.01014.96
7.3.330.0080.00013.18
7.3.320.0060.00013.31
7.3.310.0000.00716.43
7.3.300.0000.00716.27
7.3.290.0070.00016.40
7.3.280.0090.01216.38
7.3.270.0140.01017.40
7.3.260.0170.00016.45
7.3.250.0100.01116.42
7.3.240.0110.00816.38
7.3.230.0180.00616.39
7.3.210.0080.01116.50
7.3.200.0000.01719.39
7.3.190.0030.01216.59
7.3.180.0080.00816.44
7.3.170.0060.01016.59
7.3.160.0030.01316.43
7.3.10.0030.01216.36
7.3.00.0110.00316.61
7.2.330.0120.00616.68
7.2.320.0100.00716.42
7.2.310.0060.01216.62
7.2.300.0090.01016.41
7.2.290.0120.00916.68
7.2.130.0070.00316.83
7.2.120.0070.00716.88
7.2.110.0000.01316.86
7.2.100.0130.00716.93
7.2.90.0060.01016.70
7.2.80.0080.00416.79
7.2.70.0000.01316.96
7.2.60.0020.01416.85
7.2.50.0140.00316.79
7.2.40.0060.00316.64
7.2.30.0100.01016.88
7.2.20.0000.01616.69
7.2.10.0100.01017.01
7.2.00.0070.00718.06
7.1.250.0090.00015.43
7.1.200.0070.00715.48
7.1.100.0040.00718.01
7.1.70.0040.00417.19
7.1.60.0170.00719.27
7.1.50.0090.01216.86
7.1.00.0070.06722.47
7.0.200.0030.00516.91
7.0.60.0100.05021.82
7.0.50.0030.08717.90
7.0.40.0070.04020.13
7.0.30.0330.04020.24
7.0.20.0170.06320.07
7.0.10.0200.07020.05
7.0.00.0100.05020.22
5.6.280.0030.03321.18
5.6.210.0070.04320.71
5.6.200.0130.06318.21
5.6.190.0000.05020.47
5.6.180.0170.04320.43
5.6.170.0130.04720.45
5.6.160.0130.07720.51
5.6.150.0030.08718.24
5.6.140.0070.05718.13
5.6.130.0100.07718.21
5.6.120.0130.05021.00
5.6.110.0070.04021.15
5.6.100.0030.09321.11
5.6.90.0030.04021.12
5.6.80.0000.06020.33
5.5.350.0070.04020.46
5.5.340.0030.04718.04
5.5.330.0130.07720.37
5.5.320.0700.06720.34
5.5.310.0200.06020.41
5.5.300.0170.07018.08
5.5.290.0130.08017.97
5.5.280.0100.04720.79
5.5.270.0070.08720.90
5.5.260.0030.04020.91
5.5.250.0130.05020.69
5.5.240.0170.07320.25

preferences:
57.66 ms | 401 KiB | 5 Q