3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('America/Sao_Paulo'); $d1=new DateTime("2012-07-08 11:14:15.638276"); $d2=$d1; $d1->setTime(5,5); print_r( $d1 ) ; print_r( $d2 ) ;
Output for 7.1.0
DateTime Object ( [date] => 2012-07-08 05:05:00.000000 [timezone_type] => 3 [timezone] => America/Sao_Paulo ) DateTime Object ( [date] => 2012-07-08 05:05:00.000000 [timezone_type] => 3 [timezone] => America/Sao_Paulo )
Output for 5.4.30 - 7.0.14
DateTime Object ( [date] => 2012-07-08 05:05:00.638276 [timezone_type] => 3 [timezone] => America/Sao_Paulo ) DateTime Object ( [date] => 2012-07-08 05:05:00.638276 [timezone_type] => 3 [timezone] => America/Sao_Paulo )
Output for 5.3.0 - 5.4.29
DateTime Object ( [date] => 2012-07-08 05:05:00 [timezone_type] => 3 [timezone] => America/Sao_Paulo ) DateTime Object ( [date] => 2012-07-08 05:05:00 [timezone_type] => 3 [timezone] => America/Sao_Paulo )
Output for 5.2.0 - 5.2.17
DateTime Object ( ) DateTime Object ( )
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Q7g7I on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/Q7g7I on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Q7g7I on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Q7g7I on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Q7g7I on line 3