3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dateString = '2024-11-03 01:10:10.888480 America/Toronto -0500'; $date = new DateTime($dateString); var_dump($date->format('Y-m-d H:i:s.u e O')); $date->setTimestamp($date->getTimestamp() + 3600); var_dump($date->format('Y-m-d H:i:s.u e O')); $dateString = '2024-11-03 01:10:10.888480 America/Toronto -0400'; $date = new DateTime($dateString); var_dump($date->format('Y-m-d H:i:s.u e O')); $date->setTimestamp($date->getTimestamp() + 3600); var_dump($date->format('Y-m-d H:i:s.u e O')); $dateString = '2024-11-03 01:10:10.888480 America/Toronto -0500'; $date = new DateTime($dateString . ' - 1 hour'); var_dump($date->format('Y-m-d H:i:s.u e O')); $dateString = '2024-11-03 01:10:10.888480 America/Toronto -0400'; $date = new DateTime($dateString . ' - 1 hour'); var_dump($date->format('Y-m-d H:i:s.u e O')); $dateString = '2024-11-03 01:10:10.888480 America/Toronto -0500'; $date = new DateTime($dateString . ' + 1 hour'); var_dump($date->format('Y-m-d H:i:s.u e O')); $dateString = '2024-11-03 01:10:10.888480 America/Toronto -0400'; $date = new DateTime($dateString . ' + 1 hour'); var_dump($date->format('Y-m-d H:i:s.u e O'));
Output for git.master_jit, git.master
string(48) "2024-11-03 01:10:10.888480 America/Toronto -0400" string(48) "2024-11-03 01:10:10.000000 America/Toronto -0500" string(48) "2024-11-03 01:10:10.888480 America/Toronto -0400" string(48) "2024-11-03 01:10:10.000000 America/Toronto -0500" string(48) "2024-11-03 00:10:10.888480 America/Toronto -0400" string(48) "2024-11-03 00:10:10.888480 America/Toronto -0400" string(48) "2024-11-03 02:10:10.888480 America/Toronto -0500" string(48) "2024-11-03 02:10:10.888480 America/Toronto -0500"

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:
42.9 ms | 1045 KiB | 4 Q