3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo date_default_timezone_get(), PHP_EOL; echo PHP_EOL, 'time()', PHP_EOL; $timestamp = strtotime('15:00 01-02-2016'); echo date('H:i:sP', $timestamp); echo $timestamp, PHP_EOL; echo PHP_EOL, 'DateTime1', PHP_EOL; $dateTime = new DateTime('@' . $timestamp); echo $dateTime->getTimestamp(), PHP_EOL, $dateTime->format('H:i:sP'), PHP_EOL; echo PHP_EOL, 'DateTime2', PHP_EOL; $dateTime = new DateTime('@' . $timestamp); $dateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); echo $dateTime->getTimestamp(), PHP_EOL, $dateTime->format('H:i:sP'), PHP_EOL; echo $dateTime->getDay();
Output for git.master, git.master_jit, rfc.property-hooks
Europe/Amsterdam time() 15:00:00+01:001454335200 DateTime1 1454335200 14:00:00+00:00 DateTime2 1454335200 15:00:00+01:00 Fatal error: Uncaught Error: Call to undefined method DateTime::getDay() in /in/EjgMm:20 Stack trace: #0 {main} thrown in /in/EjgMm on line 20
Process exited with code 255.

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:
54.17 ms | 401 KiB | 8 Q