3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '2001-09-08'; $date = str_replace('-','/',$date); $formats_arr = array('m-d-Y','m/d/Y','Y-m-d','Y/m/d'); //$dateobj = new datetime($date); $dateobj = datetime::create($date); foreach ($formats_arr AS $format) echo $format . " ==> " . $datetime::format($format) . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/1MME3
function name:  (null)
number of ops:  25
compiled vars:  !0 = $date, !1 = $formats_arr, !2 = $dateobj, !3 = $format, !4 = $datetime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2001-09-08'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '-'
          3        SEND_VAL                                                 '%2F'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !0, $6
    6     7        ASSIGN                                                   !1, <array>
   10     8        INIT_STATIC_METHOD_CALL                                  'datetime', 'create'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
   12    12      > FE_RESET_R                                       $11     !1, ->23
         13    > > FE_FETCH_R                                               $11, !3, ->23
   13    14    >   CONCAT                                           ~12     !3, '+%3D%3D%3E+'
         15        FETCH_CLASS                                   0  $13     !4
         16        INIT_STATIC_METHOD_CALL                                  $13, 'format'
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0  $14     
         19        CONCAT                                           ~15     ~12, $14
         20        CONCAT                                           ~16     ~15, '%0A'
         21        ECHO                                                     ~16
   12    22      > JMP                                                      ->13
         23    >   FE_FREE                                                  $11
   13    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.89 ms | 1395 KiB | 15 Q