3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link https://stackoverflow.com/a/13129856/367456 */ $formats = array( 'today midnight', 'midnight', 'today', 'TODAY', 'MidNight', 'ToDaY', 'tomorrow', 'UTC today', 'today Z', 'today Europe/Berlin', 'Asia/Shanghai today', 'Asia/Shanghai', 'HKST today', ); $time = strtotime('UTC 2020-01-01 00:00:00'); printf("UTC time is: %d (script-time, is UTC 2020-01-01 00:00:00)\n", $time); if (is_callable('date_default_timezone_get')) { printf("default time-zone is: %s\n", date_default_timezone_get()); } else { printf("default time-zone is: %s\n", '???'); } foreach ($formats as $format) { printf("%'.-24s: %s\n", "$format ", strtotime($format, $time)); }
Output for git.master
UTC time is: 1577836800 (script-time, is UTC 2020-01-01 00:00:00) default time-zone is: Europe/Amsterdam today midnight .........: 1577833200 midnight ...............: 1577833200 today ..................: 1577833200 TODAY ..................: 1577833200 MidNight ...............: 1577833200 ToDaY ..................: 1577833200 tomorrow ...............: 1577919600 UTC today ..............: 1577836800 today Z ................: 1577836800 today Europe/Berlin ....: 1577833200 Asia/Shanghai today ....: 1577808000 Asia/Shanghai ..........: 1577811600 HKST today .............: 1577804400
Output for git.master_jit
UTC time is: 1577836800 (script-time, is UTC 2020-01-01 00:00:00) default time-zone is: UTC today midnight .........: 1577836800 midnight ...............: 1577836800 today ..................: 1577836800 TODAY ..................: 1577836800 MidNight ...............: 1577836800 ToDaY ..................: 1577836800 tomorrow ...............: 1577923200 UTC today ..............: 1577836800 today Z ................: 1577836800 today Europe/Berlin ....: 1577833200 Asia/Shanghai today ....: 1577808000 Asia/Shanghai ..........: 1577808000 HKST today .............: 1577804400

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.7 ms | 411 KiB | 5 Q