3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function dumpMappedRow($mappedRow) { var_dump([ 'created' => $mappedRow['created']->format(DateTime::ISO8601), 'modified' => $mappedRow['modified']->format(DateTime::ISO8601) ]); } $date = new DateTime(); $mappedRow['created'] = $date; $mappedRow['modified'] = $date; dumpMappedRow($mappedRow); $mappedRow['modified']->setDate("2015", "11", "15"); dumpMappedRow($mappedRow); if ($mappedRow['created']->getTimestamp() === $mappedRow['modified']->getTimestamp()) { echo "\nCreated and Modified are set to the same value."; }
based on 0frKf
Output for 5.6.28, 7.0.20 - 7.2.0
array(2) { ["created"]=> string(24) "2015-09-24T21:17:42+0200" ["modified"]=> string(24) "2015-09-24T21:17:42+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:42+0100" ["modified"]=> string(24) "2015-11-15T21:17:42+0100" } Created and Modified are set to the same value.
Output for 7.0.6
array(2) { ["created"]=> string(24) "2016-05-03T13:30:25+0200" ["modified"]=> string(24) "2016-05-03T13:30:25+0200" } array(2) { ["created"]=> string(24) "2015-11-15T13:30:25+0100" ["modified"]=> string(24) "2015-11-15T13:30:25+0100" } Created and Modified are set to the same value.
Output for 7.0.5
array(2) { ["created"]=> string(24) "2016-04-03T02:11:42+0200" ["modified"]=> string(24) "2016-04-03T02:11:42+0200" } array(2) { ["created"]=> string(24) "2015-11-15T02:11:42+0100" ["modified"]=> string(24) "2015-11-15T02:11:42+0100" } Created and Modified are set to the same value.
Output for 7.0.4
array(2) { ["created"]=> string(24) "2016-03-10T13:00:04+0100" ["modified"]=> string(24) "2016-03-10T13:00:04+0100" } array(2) { ["created"]=> string(24) "2015-11-15T13:00:04+0100" ["modified"]=> string(24) "2015-11-15T13:00:04+0100" } Created and Modified are set to the same value.
Output for 7.0.3
array(2) { ["created"]=> string(24) "2016-03-18T13:51:02+0100" ["modified"]=> string(24) "2016-03-18T13:51:02+0100" } array(2) { ["created"]=> string(24) "2015-11-15T13:51:02+0100" ["modified"]=> string(24) "2015-11-15T13:51:02+0100" } Created and Modified are set to the same value.
Output for 7.0.2
array(2) { ["created"]=> string(24) "2016-03-22T19:45:32+0100" ["modified"]=> string(24) "2016-03-22T19:45:32+0100" } array(2) { ["created"]=> string(24) "2015-11-15T19:45:32+0100" ["modified"]=> string(24) "2015-11-15T19:45:32+0100" } Created and Modified are set to the same value.
Output for 7.0.1
array(2) { ["created"]=> string(24) "2016-03-23T23:59:22+0100" ["modified"]=> string(24) "2016-03-23T23:59:22+0100" } array(2) { ["created"]=> string(24) "2015-11-15T23:59:22+0100" ["modified"]=> string(24) "2015-11-15T23:59:22+0100" } Created and Modified are set to the same value.
Output for 7.0.0
array(2) { ["created"]=> string(24) "2016-03-27T01:36:23+0100" ["modified"]=> string(24) "2016-03-27T01:36:23+0100" } array(2) { ["created"]=> string(24) "2015-11-15T01:36:23+0100" ["modified"]=> string(24) "2015-11-15T01:36:23+0100" } Created and Modified are set to the same value.
Output for 5.6.21
array(2) { ["created"]=> string(24) "2016-05-02T08:41:32+0200" ["modified"]=> string(24) "2016-05-02T08:41:32+0200" } array(2) { ["created"]=> string(24) "2015-11-15T08:41:32+0100" ["modified"]=> string(24) "2015-11-15T08:41:32+0100" } Created and Modified are set to the same value.
Output for 5.6.20
array(2) { ["created"]=> string(24) "2016-04-10T01:06:23+0200" ["modified"]=> string(24) "2016-04-10T01:06:23+0200" } array(2) { ["created"]=> string(24) "2015-11-15T01:06:23+0100" ["modified"]=> string(24) "2015-11-15T01:06:23+0100" } Created and Modified are set to the same value.
Output for 5.6.19
array(2) { ["created"]=> string(24) "2016-03-07T21:04:52+0100" ["modified"]=> string(24) "2016-03-07T21:04:52+0100" } array(2) { ["created"]=> string(24) "2015-11-15T21:04:52+0100" ["modified"]=> string(24) "2015-11-15T21:04:52+0100" } Created and Modified are set to the same value.
Output for 5.6.18
array(2) { ["created"]=> string(24) "2016-03-15T05:47:15+0100" ["modified"]=> string(24) "2016-03-15T05:47:15+0100" } array(2) { ["created"]=> string(24) "2015-11-15T05:47:15+0100" ["modified"]=> string(24) "2015-11-15T05:47:15+0100" } Created and Modified are set to the same value.
Output for 5.6.17
array(2) { ["created"]=> string(24) "2016-03-19T17:52:54+0100" ["modified"]=> string(24) "2016-03-19T17:52:54+0100" } array(2) { ["created"]=> string(24) "2015-11-15T17:52:54+0100" ["modified"]=> string(24) "2015-11-15T17:52:54+0100" } Created and Modified are set to the same value.
Output for 5.6.16
array(2) { ["created"]=> string(24) "2016-03-28T03:26:41+0200" ["modified"]=> string(24) "2016-03-28T03:26:41+0200" } array(2) { ["created"]=> string(24) "2015-11-15T03:26:41+0100" ["modified"]=> string(24) "2015-11-15T03:26:41+0100" } Created and Modified are set to the same value.
Output for 5.6.15
array(2) { ["created"]=> string(24) "2016-03-29T04:21:26+0200" ["modified"]=> string(24) "2016-03-29T04:21:26+0200" } array(2) { ["created"]=> string(24) "2015-11-15T04:21:26+0100" ["modified"]=> string(24) "2015-11-15T04:21:26+0100" } Created and Modified are set to the same value.
Output for 5.6.14
array(2) { ["created"]=> string(24) "2016-04-02T06:28:24+0200" ["modified"]=> string(24) "2016-04-02T06:28:24+0200" } array(2) { ["created"]=> string(24) "2015-11-15T06:28:24+0100" ["modified"]=> string(24) "2015-11-15T06:28:24+0100" } Created and Modified are set to the same value.
Output for 5.6.13
array(2) { ["created"]=> string(24) "2016-04-15T10:31:09+0200" ["modified"]=> string(24) "2016-04-15T10:31:09+0200" } array(2) { ["created"]=> string(24) "2015-11-15T10:31:09+0100" ["modified"]=> string(24) "2015-11-15T10:31:09+0100" } Created and Modified are set to the same value.
Output for 5.6.12
array(2) { ["created"]=> string(24) "2016-04-20T00:44:42+0200" ["modified"]=> string(24) "2016-04-20T00:44:42+0200" } array(2) { ["created"]=> string(24) "2015-11-15T00:44:42+0100" ["modified"]=> string(24) "2015-11-15T00:44:42+0100" } Created and Modified are set to the same value.
Output for 5.6.11
array(2) { ["created"]=> string(24) "2016-04-23T07:27:12+0200" ["modified"]=> string(24) "2016-04-23T07:27:12+0200" } array(2) { ["created"]=> string(24) "2015-11-15T07:27:12+0100" ["modified"]=> string(24) "2015-11-15T07:27:12+0100" } Created and Modified are set to the same value.
Output for 5.6.10
array(2) { ["created"]=> string(24) "2016-04-25T09:14:55+0200" ["modified"]=> string(24) "2016-04-25T09:14:55+0200" } array(2) { ["created"]=> string(24) "2015-11-15T09:14:55+0100" ["modified"]=> string(24) "2015-11-15T09:14:55+0100" } Created and Modified are set to the same value.
Output for 5.6.9
array(2) { ["created"]=> string(24) "2016-04-27T14:20:15+0200" ["modified"]=> string(24) "2016-04-27T14:20:15+0200" } array(2) { ["created"]=> string(24) "2015-11-15T14:20:15+0100" ["modified"]=> string(24) "2015-11-15T14:20:15+0100" } Created and Modified are set to the same value.
Output for 5.6.8
array(2) { ["created"]=> string(24) "2016-04-29T22:32:50+0200" ["modified"]=> string(24) "2016-04-29T22:32:50+0200" } array(2) { ["created"]=> string(24) "2015-11-15T22:32:50+0100" ["modified"]=> string(24) "2015-11-15T22:32:50+0100" } Created and Modified are set to the same value.
Output for 5.5.35
array(2) { ["created"]=> string(24) "2016-05-22T12:28:07+0200" ["modified"]=> string(24) "2016-05-22T12:28:07+0200" } array(2) { ["created"]=> string(24) "2015-11-15T12:28:07+0100" ["modified"]=> string(24) "2015-11-15T12:28:07+0100" } Created and Modified are set to the same value.
Output for 5.5.34
array(2) { ["created"]=> string(24) "2016-04-11T03:23:08+0200" ["modified"]=> string(24) "2016-04-11T03:23:08+0200" } array(2) { ["created"]=> string(24) "2015-11-15T03:23:08+0100" ["modified"]=> string(24) "2015-11-15T03:23:08+0100" } Created and Modified are set to the same value.
Output for 5.5.33
array(2) { ["created"]=> string(24) "2016-03-08T23:57:40+0100" ["modified"]=> string(24) "2016-03-08T23:57:40+0100" } array(2) { ["created"]=> string(24) "2015-11-15T23:57:40+0100" ["modified"]=> string(24) "2015-11-15T23:57:40+0100" } Created and Modified are set to the same value.
Output for 5.5.32
array(2) { ["created"]=> string(24) "2016-03-17T09:16:33+0100" ["modified"]=> string(24) "2016-03-17T09:16:33+0100" } array(2) { ["created"]=> string(24) "2015-11-15T09:16:33+0100" ["modified"]=> string(24) "2015-11-15T09:16:33+0100" } Created and Modified are set to the same value.
Output for 5.5.31
array(2) { ["created"]=> string(24) "2016-03-20T20:35:51+0100" ["modified"]=> string(24) "2016-03-20T20:35:51+0100" } array(2) { ["created"]=> string(24) "2015-11-15T20:35:51+0100" ["modified"]=> string(24) "2015-11-15T20:35:51+0100" } Created and Modified are set to the same value.
Output for 5.5.30
array(2) { ["created"]=> string(24) "2016-04-01T06:15:31+0200" ["modified"]=> string(24) "2016-04-01T06:15:31+0200" } array(2) { ["created"]=> string(24) "2015-11-15T06:15:31+0100" ["modified"]=> string(24) "2015-11-15T06:15:31+0100" } Created and Modified are set to the same value.
Output for 5.5.29
array(2) { ["created"]=> string(24) "2016-04-17T00:40:54+0200" ["modified"]=> string(24) "2016-04-17T00:40:54+0200" } array(2) { ["created"]=> string(24) "2015-11-15T00:40:54+0100" ["modified"]=> string(24) "2015-11-15T00:40:54+0100" } Created and Modified are set to the same value.
Output for 5.5.28
array(2) { ["created"]=> string(24) "2016-04-21T03:57:09+0200" ["modified"]=> string(24) "2016-04-21T03:57:09+0200" } array(2) { ["created"]=> string(24) "2015-11-15T03:57:09+0100" ["modified"]=> string(24) "2015-11-15T03:57:09+0100" } Created and Modified are set to the same value.
Output for 5.5.27
array(2) { ["created"]=> string(24) "2016-04-22T06:05:51+0200" ["modified"]=> string(24) "2016-04-22T06:05:51+0200" } array(2) { ["created"]=> string(24) "2015-11-15T06:05:51+0100" ["modified"]=> string(24) "2015-11-15T06:05:51+0100" } Created and Modified are set to the same value.
Output for 5.5.26
array(2) { ["created"]=> string(24) "2016-04-26T11:51:47+0200" ["modified"]=> string(24) "2016-04-26T11:51:47+0200" } array(2) { ["created"]=> string(24) "2015-11-15T11:51:47+0100" ["modified"]=> string(24) "2015-11-15T11:51:47+0100" } Created and Modified are set to the same value.
Output for 5.5.25
array(2) { ["created"]=> string(24) "2016-04-28T18:17:03+0200" ["modified"]=> string(24) "2016-04-28T18:17:03+0200" } array(2) { ["created"]=> string(24) "2015-11-15T18:17:03+0100" ["modified"]=> string(24) "2015-11-15T18:17:03+0100" } Created and Modified are set to the same value.
Output for 5.5.24
array(2) { ["created"]=> string(24) "2016-05-24T01:30:57+0200" ["modified"]=> string(24) "2016-05-24T01:30:57+0200" } array(2) { ["created"]=> string(24) "2015-11-15T01:30:57+0100" ["modified"]=> string(24) "2015-11-15T01:30:57+0100" } Created and Modified are set to the same value.
Output for 5.4.45
array(2) { ["created"]=> string(24) "2015-09-24T21:17:51+0200" ["modified"]=> string(24) "2015-09-24T21:17:51+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:51+0100" ["modified"]=> string(24) "2015-11-15T21:17:51+0100" } Created and Modified are set to the same value.
Output for 5.4.37 - 5.4.44
array(2) { ["created"]=> string(24) "2015-09-24T21:17:52+0200" ["modified"]=> string(24) "2015-09-24T21:17:52+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:52+0100" ["modified"]=> string(24) "2015-11-15T21:17:52+0100" } Created and Modified are set to the same value.
Output for 5.4.29 - 5.4.36
array(2) { ["created"]=> string(24) "2015-09-24T21:17:53+0200" ["modified"]=> string(24) "2015-09-24T21:17:53+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:53+0100" ["modified"]=> string(24) "2015-11-15T21:17:53+0100" } Created and Modified are set to the same value.
Output for 5.4.21 - 5.4.28
array(2) { ["created"]=> string(24) "2015-09-24T21:17:54+0200" ["modified"]=> string(24) "2015-09-24T21:17:54+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:54+0100" ["modified"]=> string(24) "2015-11-15T21:17:54+0100" } Created and Modified are set to the same value.
Output for 5.4.13 - 5.4.20
array(2) { ["created"]=> string(24) "2015-09-24T21:17:55+0200" ["modified"]=> string(24) "2015-09-24T21:17:55+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:55+0100" ["modified"]=> string(24) "2015-11-15T21:17:55+0100" } Created and Modified are set to the same value.
Output for 5.4.8 - 5.4.12
array(2) { ["created"]=> string(24) "2015-09-24T21:17:56+0200" ["modified"]=> string(24) "2015-09-24T21:17:56+0200" } array(2) { ["created"]=> string(24) "2015-11-15T21:17:56+0100" ["modified"]=> string(24) "2015-11-15T21:17:56+0100" } Created and Modified are set to the same value.
Output for 5.4.7
array(2) { ["created"]=> string(24) "2015-10-27T02:10:20+0100" ["modified"]=> string(24) "2015-10-27T02:10:20+0100" } array(2) { ["created"]=> string(24) "2015-11-15T02:10:20+0100" ["modified"]=> string(24) "2015-11-15T02:10:20+0100" } Created and Modified are set to the same value.
Output for 5.4.6
array(2) { ["created"]=> string(24) "2015-10-27T03:38:32+0100" ["modified"]=> string(24) "2015-10-27T03:38:32+0100" } array(2) { ["created"]=> string(24) "2015-11-15T03:38:32+0100" ["modified"]=> string(24) "2015-11-15T03:38:32+0100" } Created and Modified are set to the same value.
Output for 5.4.5
array(2) { ["created"]=> string(24) "2015-10-27T05:08:09+0100" ["modified"]=> string(24) "2015-10-27T05:08:09+0100" } array(2) { ["created"]=> string(24) "2015-11-15T05:08:09+0100" ["modified"]=> string(24) "2015-11-15T05:08:09+0100" } Created and Modified are set to the same value.
Output for 5.4.4
array(2) { ["created"]=> string(24) "2015-10-27T06:46:28+0100" ["modified"]=> string(24) "2015-10-27T06:46:28+0100" } array(2) { ["created"]=> string(24) "2015-11-15T06:46:28+0100" ["modified"]=> string(24) "2015-11-15T06:46:28+0100" } Created and Modified are set to the same value.
Output for 5.4.3
array(2) { ["created"]=> string(24) "2015-10-27T08:27:51+0100" ["modified"]=> string(24) "2015-10-27T08:27:51+0100" } array(2) { ["created"]=> string(24) "2015-11-15T08:27:51+0100" ["modified"]=> string(24) "2015-11-15T08:27:51+0100" } Created and Modified are set to the same value.
Output for 5.4.2
array(2) { ["created"]=> string(24) "2015-10-27T08:33:27+0100" ["modified"]=> string(24) "2015-10-27T08:33:27+0100" } array(2) { ["created"]=> string(24) "2015-11-15T08:33:27+0100" ["modified"]=> string(24) "2015-11-15T08:33:27+0100" } Created and Modified are set to the same value.
Output for 5.4.1
array(2) { ["created"]=> string(24) "2015-10-27T10:20:40+0100" ["modified"]=> string(24) "2015-10-27T10:20:40+0100" } array(2) { ["created"]=> string(24) "2015-11-15T10:20:40+0100" ["modified"]=> string(24) "2015-11-15T10:20:40+0100" } Created and Modified are set to the same value.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/5jNca on line 5
Process exited with code 255.