3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('now'); $firstOfMonth = $date->modify('first day of this month')->format(DATE_ISO8601); $lastOfMonth = $date->modify('last day of this month')->format(DATE_ISO8601); var_dump(array($firstOfMonth, $lastOfMonth));
Output for 5.6.28, 7.0.12 - 7.1.0
array(2) { [0]=> string(24) "2013-12-01T11:51:39+0100" [1]=> string(24) "2013-12-31T11:51:39+0100" }
Output for 7.0.6
array(2) { [0]=> string(24) "2016-05-01T17:46:49+0200" [1]=> string(24) "2016-05-31T17:46:49+0200" }
Output for 7.0.5
array(2) { [0]=> string(24) "2016-04-01T06:14:41+0200" [1]=> string(24) "2016-04-30T06:14:41+0200" }
Output for 7.0.4
array(2) { [0]=> string(24) "2016-03-01T17:57:07+0100" [1]=> string(24) "2016-03-31T17:57:07+0200" }
Output for 7.0.3
array(2) { [0]=> string(24) "2016-03-01T18:46:22+0100" [1]=> string(24) "2016-03-31T18:46:22+0200" }
Output for 7.0.2
array(2) { [0]=> string(24) "2016-03-01T01:10:11+0100" [1]=> string(24) "2016-03-31T01:10:11+0200" }
Output for 7.0.1
array(2) { [0]=> string(24) "2016-03-01T04:55:23+0100" [1]=> string(24) "2016-03-31T04:55:23+0200" }
Output for 7.0.0
array(2) { [0]=> string(24) "2016-03-01T06:52:07+0100" [1]=> string(24) "2016-03-31T06:52:07+0200" }
Output for hhvm-3.12.0
array(2) { [0]=> string(24) "2016-03-01T07:33:13+0100" [1]=> string(24) "2016-03-31T07:33:13+0200" }
Output for hhvm-3.10.0
array(2) { [0]=> string(24) "2016-03-01T00:27:01+0100" [1]=> string(24) "2016-03-31T00:27:01+0200" }
Output for 5.6.21
array(2) { [0]=> string(24) "2016-05-01T12:57:10+0200" [1]=> string(24) "2016-05-31T12:57:10+0200" }
Output for 5.6.20
array(2) { [0]=> string(24) "2016-04-01T05:13:46+0200" [1]=> string(24) "2016-04-30T05:13:46+0200" }
Output for 5.6.19
array(2) { [0]=> string(24) "2016-03-01T02:08:58+0100" [1]=> string(24) "2016-03-31T02:08:58+0200" }
Output for 5.6.18
array(2) { [0]=> string(24) "2016-03-01T10:44:28+0100" [1]=> string(24) "2016-03-31T10:44:28+0200" }
Output for 5.6.17
array(2) { [0]=> string(24) "2016-03-01T22:31:31+0100" [1]=> string(24) "2016-03-31T22:31:31+0200" }
Output for 5.6.16
array(2) { [0]=> string(24) "2016-03-01T07:39:22+0100" [1]=> string(24) "2016-03-31T07:39:22+0200" }
Output for 5.6.15
array(2) { [0]=> string(24) "2016-03-01T08:30:19+0100" [1]=> string(24) "2016-03-31T08:30:19+0200" }
Output for 5.6.14
array(2) { [0]=> string(24) "2016-04-01T10:24:11+0200" [1]=> string(24) "2016-04-30T10:24:11+0200" }
Output for 5.6.13
array(2) { [0]=> string(24) "2016-04-01T14:44:15+0200" [1]=> string(24) "2016-04-30T14:44:15+0200" }
Output for 5.6.12
array(2) { [0]=> string(24) "2016-04-01T05:12:27+0200" [1]=> string(24) "2016-04-30T05:12:27+0200" }
Output for 5.6.11
array(2) { [0]=> string(24) "2016-04-01T11:28:01+0200" [1]=> string(24) "2016-04-30T11:28:01+0200" }
Output for 5.6.10
array(2) { [0]=> string(24) "2016-04-01T13:37:44+0200" [1]=> string(24) "2016-04-30T13:37:44+0200" }
Output for 5.6.9
array(2) { [0]=> string(24) "2016-04-01T18:47:06+0200" [1]=> string(24) "2016-04-30T18:47:06+0200" }
Output for 5.6.8
array(2) { [0]=> string(24) "2016-04-01T03:39:17+0200" [1]=> string(24) "2016-04-30T03:39:17+0200" }
Output for 5.5.35
array(2) { [0]=> string(24) "2016-05-01T19:08:11+0200" [1]=> string(24) "2016-05-31T19:08:11+0200" }
Output for 5.5.34
array(2) { [0]=> string(24) "2016-04-01T07:26:21+0200" [1]=> string(24) "2016-04-30T07:26:21+0200" }
Output for 5.5.33
array(2) { [0]=> string(24) "2016-03-01T04:45:09+0100" [1]=> string(24) "2016-03-31T04:45:09+0200" }
Output for 5.5.32
array(2) { [0]=> string(24) "2016-03-01T14:27:57+0100" [1]=> string(24) "2016-03-31T14:27:57+0200" }
Output for 5.5.31
array(2) { [0]=> string(24) "2016-03-01T01:29:36+0100" [1]=> string(24) "2016-03-31T01:29:36+0200" }
Output for 5.5.30
array(2) { [0]=> string(24) "2016-04-01T10:23:49+0200" [1]=> string(24) "2016-04-30T10:23:49+0200" }
Output for 5.5.29
array(2) { [0]=> string(24) "2016-04-01T05:08:28+0200" [1]=> string(24) "2016-04-30T05:08:28+0200" }
Output for 5.5.28
array(2) { [0]=> string(24) "2016-04-01T08:25:08+0200" [1]=> string(24) "2016-04-30T08:25:08+0200" }
Output for 5.5.27
array(2) { [0]=> string(24) "2016-04-01T10:14:38+0200" [1]=> string(24) "2016-04-30T10:14:38+0200" }
Output for 5.5.26
array(2) { [0]=> string(24) "2016-04-01T16:20:22+0200" [1]=> string(24) "2016-04-30T16:20:22+0200" }
Output for 5.5.25
array(2) { [0]=> string(24) "2016-04-01T23:11:33+0200" [1]=> string(24) "2016-04-30T23:11:33+0200" }
Output for 5.5.24
array(2) { [0]=> string(24) "2016-05-01T05:47:19+0200" [1]=> string(24) "2016-05-31T05:47:19+0200" }
Output for 5.4.44 - 5.4.45
array(2) { [0]=> string(24) "2016-02-01T11:01:11+0100" [1]=> string(24) "2016-02-29T11:01:11+0100" }
Output for 5.4.42 - 5.4.43
array(2) { [0]=> string(24) "2016-02-01T11:01:12+0100" [1]=> string(24) "2016-02-29T11:01:12+0100" }
Output for 5.4.41
array(2) { [0]=> string(24) "2016-02-01T11:01:13+0100" [1]=> string(24) "2016-02-29T11:01:13+0100" }
Output for 5.4.38 - 5.4.40
array(2) { [0]=> string(24) "2016-02-01T11:01:14+0100" [1]=> string(24) "2016-02-29T11:01:14+0100" }
Output for 5.4.36 - 5.4.37
array(2) { [0]=> string(24) "2016-02-01T11:01:15+0100" [1]=> string(24) "2016-02-29T11:01:15+0100" }
Output for 5.4.34 - 5.4.35
array(2) { [0]=> string(24) "2016-02-01T11:01:16+0100" [1]=> string(24) "2016-02-29T11:01:16+0100" }
Output for 5.3.29, 5.4.31 - 5.4.32
array(2) { [0]=> string(24) "2016-02-01T11:01:17+0100" [1]=> string(24) "2016-02-29T11:01:17+0100" }
Output for 5.4.28 - 5.4.30
array(2) { [0]=> string(24) "2016-02-01T11:01:18+0100" [1]=> string(24) "2016-02-29T11:01:18+0100" }
Output for 5.4.25 - 5.4.27
array(2) { [0]=> string(24) "2016-02-01T11:01:19+0100" [1]=> string(24) "2016-02-29T11:01:19+0100" }
Output for 5.3.28, 5.4.23 - 5.4.24
array(2) { [0]=> string(24) "2016-02-01T11:01:20+0100" [1]=> string(24) "2016-02-29T11:01:20+0100" }
Output for 5.4.19 - 5.4.22
array(2) { [0]=> string(24) "2016-02-01T11:01:21+0100" [1]=> string(24) "2016-02-29T11:01:21+0100" }
Output for 5.3.27, 5.4.16 - 5.4.18
array(2) { [0]=> string(24) "2016-02-01T11:01:22+0100" [1]=> string(24) "2016-02-29T11:01:22+0100" }
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.15
array(2) { [0]=> string(24) "2016-02-01T11:01:23+0100" [1]=> string(24) "2016-02-29T11:01:23+0100" }
Output for 5.3.20 - 5.3.22, 5.4.9 - 5.4.12
array(2) { [0]=> string(24) "2016-02-01T11:01:24+0100" [1]=> string(24) "2016-02-29T11:01:24+0100" }
Output for 5.3.17 - 5.3.19, 5.4.6 - 5.4.8
array(2) { [0]=> string(24) "2016-02-01T11:01:25+0100" [1]=> string(24) "2016-02-29T11:01:25+0100" }
Output for 5.3.13 - 5.3.16, 5.4.3 - 5.4.5
array(2) { [0]=> string(24) "2016-02-01T11:01:26+0100" [1]=> string(24) "2016-02-29T11:01:26+0100" }
Output for 5.3.9 - 5.3.12, 5.4.0 - 5.4.2
array(2) { [0]=> string(24) "2016-02-01T11:01:27+0100" [1]=> string(24) "2016-02-29T11:01:27+0100" }
Output for 5.3.4 - 5.3.8
array(2) { [0]=> string(24) "2016-02-01T11:01:28+0100" [1]=> string(24) "2016-02-29T11:01:28+0100" }
Output for 5.3.1 - 5.3.3
array(2) { [0]=> string(24) "2016-02-01T11:01:29+0100" [1]=> string(24) "2016-02-29T11:01:29+0100" }
Output for 5.3.0
array(2) { [0]=> string(24) "2016-02-01T11:01:30+0100" [1]=> string(24) "2016-02-29T11:01:30+0100" }
Output for 5.2.13 - 5.2.17
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/FeYcr on line 5 Fatal error: Call to a member function format() on a non-object in /in/FeYcr on line 5
Process exited with code 255.
Output for 5.2.0 - 5.2.12
Fatal error: Call to a member function format() on a non-object in /in/FeYcr on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/FeYcr on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/FeYcr on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/FeYcr on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/FeYcr on line 5
Process exited with code 255.