3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function mappedRow($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);
based on In6vM
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function dumpMappedRow() in /in/HSViv:16 Stack trace: #0 {main} thrown in /in/HSViv on line 16
Process exited with code 255.
Output for 5.4.1 - 5.6.28
Fatal error: Call to undefined function dumpMappedRow() in /in/HSViv on line 16
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/HSViv on line 5
Process exited with code 255.