3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.53 ms | 1395 KiB | 15 Q