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) ]); } function objectDemo() { $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."; } } function stringDemo() { $date = "2015-09-24T21:17:43+0200"; $mappedRow['created'] = $date; $mappedRow['modified'] = $date; var_dump($mappedRow); $mappedRow['modified'] = "2015-11-24T21:17:43+0200"; var_dump($mappedRow); if ($mappedRow['created'] === $mappedRow['modified']) { echo "\nCreated and Modified are set to the same value."; } } objectDemo(); echo "\n\n==========\n\n"; stringDemo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g9cEZ
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   INIT_FCALL                                               'objectdemo'
          1        DO_FCALL                                      0          
   50     2        ECHO                                                     '%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A'
   51     3        INIT_FCALL                                               'stringdemo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function dumpmappedrow:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g9cEZ
function name:  dumpMappedRow
number of ops:  15
compiled vars:  !0 = $mappedRow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'var_dump'
    6     2        FETCH_DIM_R                                      ~1      !0, 'created'
          3        INIT_METHOD_CALL                                         ~1, 'format'
          4        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsO'
          5        DO_FCALL                                      0  $2      
          6        INIT_ARRAY                                       ~3      $2, 'created'
    7     7        FETCH_DIM_R                                      ~4      !0, 'modified'
          8        INIT_METHOD_CALL                                         ~4, 'format'
          9        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsO'
         10        DO_FCALL                                      0  $5      
         11        ADD_ARRAY_ELEMENT                                ~3      $5, 'modified'
         12        SEND_VAL                                                 ~3
         13        DO_ICALL                                                 
    9    14      > RETURN                                                   null

End of function dumpmappedrow

Function objectdemo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/g9cEZ
function name:  objectDemo
number of ops:  29
compiled vars:  !0 = $date, !1 = $mappedRow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        ASSIGN_DIM                                               !1, 'created'
          4        OP_DATA                                                  !0
   16     5        ASSIGN_DIM                                               !1, 'modified'
          6        OP_DATA                                                  !0
   18     7        INIT_FCALL                                               'dumpmappedrow'
          8        SEND_VAR                                                 !1
          9        DO_FCALL                                      0          
   20    10        FETCH_DIM_R                                      ~8      !1, 'modified'
         11        INIT_METHOD_CALL                                         ~8, 'setDate'
         12        SEND_VAL_EX                                              '2015'
         13        SEND_VAL_EX                                              '11'
         14        SEND_VAL_EX                                              '15'
         15        DO_FCALL                                      0          
   22    16        INIT_FCALL                                               'dumpmappedrow'
         17        SEND_VAR                                                 !1
         18        DO_FCALL                                      0          
   24    19        FETCH_DIM_R                                      ~11     !1, 'created'
         20        INIT_METHOD_CALL                                         ~11, 'getTimestamp'
         21        DO_FCALL                                      0  $12     
         22        FETCH_DIM_R                                      ~13     !1, 'modified'
         23        INIT_METHOD_CALL                                         ~13, 'getTimestamp'
         24        DO_FCALL                                      0  $14     
         25        IS_IDENTICAL                                             $12, $14
         26      > JMPZ                                                     ~15, ->28
   25    27    >   ECHO                                                     '%0ACreated+and+Modified+are+set+to+the+same+value.'
   28    28    > > RETURN                                                   null

End of function objectdemo

Function stringdemo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/g9cEZ
function name:  stringDemo
number of ops:  19
compiled vars:  !0 = $date, !1 = $mappedRow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ASSIGN                                                   !0, '2015-09-24T21%3A17%3A43%2B0200'
   34     1        ASSIGN_DIM                                               !1, 'created'
          2        OP_DATA                                                  !0
   35     3        ASSIGN_DIM                                               !1, 'modified'
          4        OP_DATA                                                  !0
   37     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   39     8        ASSIGN_DIM                                               !1, 'modified'
          9        OP_DATA                                                  '2015-11-24T21%3A17%3A43%2B0200'
   41    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
   43    13        FETCH_DIM_R                                      ~8      !1, 'created'
         14        FETCH_DIM_R                                      ~9      !1, 'modified'
         15        IS_IDENTICAL                                             ~8, ~9
         16      > JMPZ                                                     ~10, ->18
   44    17    >   ECHO                                                     '%0ACreated+and+Modified+are+set+to+the+same+value.'
   47    18    > > RETURN                                                   null

End of function stringdemo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.4 ms | 1403 KiB | 19 Q