3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = [null, '2015-12-30', new \DateTime('now')]; foreach ($dates as &$date) { if ($date instanceof \DateTime) { $date = $date->format('Y-m-d'); } } var_dump($dates);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/iJVta
function name:  (null)
number of ops:  21
compiled vars:  !0 = $dates, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~2      null
          1        ADD_ARRAY_ELEMENT                                ~2      '2015-12-30'
          2        NEW                                              $3      'DateTime'
          3        SEND_VAL_EX                                              'now'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~2      $3
          6        ASSIGN                                                   !0, ~2
    5     7      > FE_RESET_RW                                      $6      !0, ->16
          8    > > FE_FETCH_RW                                              $6, !1, ->16
    6     9    >   INSTANCEOF                                               !1, 'DateTime'
         10      > JMPZ                                                     ~7, ->15
    7    11    >   INIT_METHOD_CALL                                         !1, 'format'
         12        SEND_VAL_EX                                              'Y-m-d'
         13        DO_FCALL                                      0  $8      
         14        ASSIGN                                                   !1, $8
    5    15    > > JMP                                                      ->8
         16    >   FE_FREE                                                  $6
   11    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.01 ms | 1395 KiB | 15 Q