3v4l.org

run code in 300+ PHP versions simultaneously
<?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); $mappedRows['modified']->add(new DateInterval("1D")); dumpMappedRow($mappedRow);
Output for 8.3.0 - 8.3.6
array(2) { ["created"]=> string(24) "2015-09-24T21:13:51+0200" ["modified"]=> string(24) "2015-09-24T21:13:51+0200" } Warning: Undefined variable $mappedRows in /in/KjkHD on line 18 Warning: Trying to access array offset on null in /in/KjkHD on line 18 Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
array(2) { ["created"]=> string(24) "2015-09-24T21:13:51+0200" ["modified"]=> string(24) "2015-09-24T21:13:51+0200" } Warning: Undefined variable $mappedRows in /in/KjkHD on line 18 Warning: Trying to access array offset on value of type null in /in/KjkHD on line 18 Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 8.0.13
array(2) { ["created"]=> string(24) "2015-09-24T19:13:51+0000" ["modified"]=> string(24) "2015-09-24T19:13:51+0000" } Warning: Undefined variable $mappedRows in /in/KjkHD on line 18 Warning: Trying to access array offset on value of type null in /in/KjkHD on line 18 Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 7.4.0 - 7.4.33
array(2) { ["created"]=> string(24) "2015-09-24T21:13:51+0200" ["modified"]=> string(24) "2015-09-24T21:13:51+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Notice: Trying to access array offset on value of type null in /in/KjkHD on line 18 Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 7.3.32 - 7.3.33
array(2) { ["created"]=> string(24) "2015-09-24T19:13:51+0000" ["modified"]=> string(24) "2015-09-24T19:13:51+0000" } Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 7.0.0 - 7.0.6, 7.0.8 - 7.0.26, 7.0.30, 7.0.32 - 7.0.33, 7.1.0 - 7.1.18, 7.1.20 - 7.1.33, 7.2.0 - 7.2.5, 7.2.7 - 7.2.33, 7.3.0 - 7.3.31
array(2) { ["created"]=> string(24) "2015-09-24T21:13:51+0200" ["modified"]=> string(24) "2015-09-24T21:13:51+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 7.0.7, 7.0.27 - 7.0.29, 7.0.31, 7.1.19, 7.2.6
array(2) { ["created"]=> string(24) "2015-09-24T21:13:52+0200" ["modified"]=> string(24) "2015-09-24T21:13:52+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Fatal error: Uncaught Error: Call to a member function add() on null in /in/KjkHD:18 Stack trace: #0 {main} thrown in /in/KjkHD on line 18
Process exited with code 255.
Output for 5.6.0 - 5.6.34, 5.6.36, 5.6.38 - 5.6.40
array(2) { ["created"]=> string(24) "2015-09-24T21:13:51+0200" ["modified"]=> string(24) "2015-09-24T21:13:51+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Fatal error: Call to a member function add() on null in /in/KjkHD on line 18
Process exited with code 255.
Output for 5.6.35, 5.6.37
array(2) { ["created"]=> string(24) "2015-09-24T21:13:52+0200" ["modified"]=> string(24) "2015-09-24T21:13:52+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Fatal error: Call to a member function add() on null in /in/KjkHD on line 18
Process exited with code 255.
Output for 5.5.37 - 5.5.38
array(2) { ["created"]=> string(24) "2015-09-24T21:13:52+0200" ["modified"]=> string(24) "2015-09-24T21:13:52+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Fatal error: Call to a member function add() on a non-object in /in/KjkHD on line 18
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.36
array(2) { ["created"]=> string(24) "2015-09-24T21:13:51+0200" ["modified"]=> string(24) "2015-09-24T21:13:51+0200" } Notice: Undefined variable: mappedRows in /in/KjkHD on line 18 Fatal error: Call to a member function add() on a non-object in /in/KjkHD on line 18
Process exited with code 255.

preferences:
283.62 ms | 402 KiB | 376 Q