3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Variables used in this script: // $summary - text title of the event // $datestart - the starting date (in seconds since unix epoch) // $dateend - the ending date (in seconds since unix epoch) // $address - the event's address // $uri - the URL of the event (add http://) // $description - text description of the event // $filename - the name of this file for saving (e.g. my-event-name.ics) // // Notes: // - the UID should be unique to the event, so in this case I'm just using // uniqid to create a uid, but you could do whatever you'd like. // // - iCal requires a date format of "yyyymmddThhiissZ". The "T" and "Z" // characters are not placeholders, just plain ol' characters. The "T" // character acts as a delimeter between the date (yyyymmdd) and the time // (hhiiss), and the "Z" states that the date is in UTC time. Note that if // you don't want to use UTC time, you must prepend your date-time values // with a TZID property. See RFC 5545 section 3.3.5 // // - The Content-Disposition: attachment; header tells the browser to save/open // the file. The filename param sets the name of the file, so you could set // it as "my-event-name.ics" or something similar. // // - Read up on RFC 5545, the iCalendar specification. There is a lot of helpful // info in there, such as formatting rules. There are also many more options // to set, including alarms, invitees, busy status, etc. // // https://www.ietf.org/rfc/rfc5545.txt // 1. Set the correct headers for this file header('Content-type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename=' . $filename); // 2. Define helper functions // Converts a unix timestamp to an ics-friendly format // NOTE: "Z" means that this timestamp is a UTC timestamp. If you need // to set a locale, remove the "\Z" and modify DTEND, DTSTAMP and DTSTART // with TZID properties (see RFC 5545 section 3.3.5 for info) // // Also note that we are using "H" instead of "g" because iCalendar's Time format // requires 24-hour time (see RFC 5545 section 3.3.12 for info). function dateToCal($timestamp) { return date('Ymd\THis\Z', $timestamp); } // Escapes a string of characters function escapeString($string) { return preg_replace('/([\,;])/','\\\$1', $string); } // 3. Echo out the ics file's contents ?> BEGIN:VCALENDAR VERSION:2.0 PRODID:-//hacksw/handcal//NONSGML v1.0//EN CALSCALE:GREGORIAN BEGIN:VEVENT DTEND:<?= dateToCal($dateend) ?> UID:<?= uniqid() ?> DTSTAMP:<?= dateToCal(time()) ?> LOCATION:<?= escapeString($address) ?> DESCRIPTION:<?= escapeString($description) ?> URL;VALUE=URI:<?= escapeString($uri) ?> SUMMARY:<?= escapeString($summary) ?> DTSTART:<?= dateToCal($datestart) ?> END:VEVENT END:VCALENDAR

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)
7.2.00.0040.01219.70
7.1.70.0070.00017.48
7.1.60.0060.01619.82
7.1.50.0030.02117.32
7.1.00.0000.08022.49
7.0.200.0070.00717.14
7.0.140.0000.07022.04
7.0.100.0400.07720.06
7.0.90.0300.06319.98
7.0.80.0330.07719.97
7.0.70.0300.05720.16
7.0.60.0330.07719.82
7.0.50.0500.07720.28
7.0.40.0170.06020.02
7.0.30.0070.08320.14
7.0.20.0030.07720.13
7.0.10.0170.06320.14
7.0.00.0130.06720.09
5.6.280.0030.07021.00
5.6.250.0070.07720.72
5.6.240.0100.07320.55
5.6.230.0070.07320.63
5.6.220.0030.04020.65
5.6.210.0030.08320.60
5.6.200.0100.06021.05
5.6.190.0070.05021.06
5.6.180.0100.03721.08
5.6.170.0100.08321.02
5.6.160.0070.08021.11
5.6.150.0130.07320.95
5.6.140.0070.08021.17
5.6.130.0130.07721.04
5.6.120.0170.06721.11
5.6.110.0100.06721.02
5.6.100.0130.04321.03
5.6.90.0100.06020.93
5.6.80.0070.07720.43
5.6.70.0130.07020.55
5.6.60.0030.08720.29
5.6.50.0070.08320.47
5.6.40.0030.07320.42
5.6.30.0070.08020.49
5.6.20.0130.07320.46
5.6.10.0070.08020.29
5.6.00.0100.06320.30
5.5.380.0100.06720.44
5.5.370.0070.08020.57
5.5.360.0000.04320.40
5.5.350.0030.04020.45
5.5.340.0000.05020.89
5.5.330.0030.09020.92
5.5.320.0100.08020.80
5.5.310.0100.07020.87
5.5.300.0070.05020.89
5.5.290.0070.08320.93
5.5.280.0030.08720.89
5.5.270.0030.09020.79
5.5.260.0170.06020.89
5.5.250.0130.07320.55
5.5.240.0100.07020.22
5.5.230.0100.08320.11
5.5.220.0070.08720.18
5.5.210.0070.07320.09
5.5.200.0170.07020.12
5.5.190.0030.07720.22
5.5.180.0130.07720.11
5.5.160.0100.07020.23
5.5.150.0070.08320.14
5.5.140.0100.07020.28
5.5.130.0130.07320.21
5.5.120.0000.08720.22
5.5.110.0100.07320.18
5.5.100.0070.06020.11
5.5.90.0130.07020.15
5.5.80.0070.07720.07
5.5.70.0070.08020.07
5.5.60.0200.04319.96
5.5.50.0130.03320.06
5.5.40.0070.04720.06
5.5.30.0030.04720.03
5.5.20.0130.05320.06
5.5.10.0030.08320.13
5.5.00.0030.06720.03
5.4.450.0030.09019.56
5.4.440.0100.07719.42
5.4.430.0030.08719.37
5.4.420.0170.07019.48
5.4.410.0070.05319.15
5.4.400.0000.07018.88
5.4.390.0100.07019.14
5.4.380.0030.06018.95
5.4.370.0030.07719.14
5.4.360.0100.07319.13
5.4.350.0100.08019.03
5.4.340.0170.07019.13
5.4.320.0100.05719.18
5.4.310.0030.06319.05
5.4.300.0100.08019.13
5.4.290.0030.08319.16
5.4.280.0100.07719.02
5.4.270.0000.08318.90
5.4.260.0070.06318.87
5.4.250.0070.08018.90
5.4.240.0170.06318.93
5.4.230.0100.07318.85
5.4.220.0030.08019.04
5.4.210.0170.06319.20
5.4.200.0070.09019.12
5.4.190.0070.08019.22
5.4.180.0070.04319.11
5.4.170.0100.07319.15
5.4.160.0030.08018.84
5.4.150.0100.04319.21
5.4.140.0030.07716.39
5.4.130.0030.07716.30
5.4.120.0100.07316.48
5.4.110.0070.07016.34
5.4.100.0070.06016.48
5.4.90.0130.05316.52
5.4.80.0000.04716.54
5.4.70.0030.07316.54
5.4.60.0000.07716.45
5.4.50.0070.07716.48
5.4.40.0030.07716.30
5.4.30.0070.04716.36
5.4.20.0030.07016.44
5.4.10.0030.07016.46
5.4.00.0070.07015.59
5.3.290.0030.08714.71
5.3.280.0070.07714.61
5.3.270.0070.07014.54
5.3.260.0000.05014.55
5.3.250.0070.07314.61
5.3.240.0030.07314.67
5.3.230.0030.07714.57
5.3.220.0130.05714.52
5.3.210.0070.08014.66
5.3.200.0100.06714.63
5.3.190.0070.07314.63
5.3.180.0030.07714.55
5.3.170.0070.04014.51
5.3.160.0100.06314.62
5.3.150.0030.05714.60
5.3.140.0100.07014.58
5.3.130.0130.06714.66
5.3.120.0030.07714.52
5.3.110.0030.08014.56
5.3.100.0070.07314.11
5.3.90.0100.05014.04
5.3.80.0100.06713.91
5.3.70.0030.07714.08
5.3.60.0070.04014.10
5.3.50.0100.06714.09
5.3.40.0000.04313.94
5.3.30.0070.06714.04
5.3.20.0130.06313.58
5.3.10.0000.07313.75
5.3.00.0130.07013.53
5.2.170.0100.06011.14
5.2.160.0030.04011.26
5.2.150.0100.03011.14
5.2.140.0100.06011.21
5.2.130.0100.03711.03
5.2.120.0200.03311.04
5.2.110.0030.06311.04
5.2.100.0030.04711.14
5.2.90.0100.03311.10
5.2.80.0100.03011.16
5.2.70.0070.05310.98
5.2.60.0130.04311.14
5.2.50.0000.06711.11
5.2.40.0030.06310.91
5.2.30.0100.05710.89
5.2.20.0000.03710.98
5.2.10.0030.05710.92
5.2.00.0070.04010.59
5.1.60.0000.04310.12
5.1.50.0030.05010.09
5.1.40.0030.0539.99
5.1.30.0100.05310.46
5.1.20.0100.05010.49
5.1.10.0030.0539.91
5.1.00.0070.04310.07
5.0.50.0070.0238.63
5.0.40.0100.0338.52
5.0.30.0000.0538.22
5.0.20.0030.0278.16
5.0.10.0130.0338.25
5.0.00.0030.0638.25
4.4.90.0030.0377.25
4.4.80.0000.0377.25
4.4.70.0000.0377.25
4.4.60.0070.0307.25
4.4.50.0000.0377.25
4.4.40.0070.0507.25
4.4.30.0000.0377.25
4.4.20.0000.0207.25
4.4.10.0030.0337.25
4.4.00.0030.0337.25
4.3.110.0030.0307.25
4.3.100.0070.0237.25
4.3.90.0030.0377.25
4.3.80.0030.0537.25
4.3.70.0000.0237.25
4.3.60.0030.0207.25
4.3.50.0000.0377.25
4.3.40.0030.0377.25
4.3.30.0000.0207.25
4.3.20.0000.0377.25
4.3.10.0070.0307.25
4.3.00.0030.0307.25

preferences:
38.33 ms | 400 KiB | 5 Q