3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $userTimezone = new \DateTimezone('Europe/Helsinki'); $from = new \DateTime( 'now', $userTimezone ); $from->modify( 'first day of this month' ); $from->setTime(0,0,0); $from->setTimezone( new \DateTimeZone( 'UTC' ) ); $from2 = clone $from; $mongoTime = $from2->getTimestamp();
Output for 5.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.2.13 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 8 Warning: DateTime::modify(): Failed to parse time string (first day of this month) at position 10 (o): The timezone could not be found in the database in /in/Na0iX on line 5 Fatal error: Call to undefined method DateTime::getTimestamp() in /in/Na0iX on line 12
Process exited with code 255.
Output for 5.2.0 - 5.2.12
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 8 Fatal error: Call to undefined method DateTime::getTimestamp() in /in/Na0iX on line 12
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 8 Fatal error: Class 'DateTimezone' not found in /in/Na0iX on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 8 Parse error: syntax error, unexpected T_VARIABLE in /in/Na0iX on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 8 Parse error: parse error, unexpected T_VARIABLE in /in/Na0iX on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Na0iX on line 8 Parse error: parse error in /in/Na0iX on line 10
Process exited with code 255.