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); 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/ANn8J
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>
    8     8        NEW                                              $9      'datetime'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
   10    12      > FE_RESET_R                                       $12     !1, ->23
         13    > > FE_FETCH_R                                               $12, !3, ->23
   11    14    >   CONCAT                                           ~13     !3, '+%3D%3D%3E+'
         15        FETCH_CLASS                                   0  $14     !4
         16        INIT_STATIC_METHOD_CALL                                  $14, 'format'
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0  $15     
         19        CONCAT                                           ~16     ~13, $15
         20        CONCAT                                           ~17     ~16, '%0A'
         21        ECHO                                                     ~17
   10    22      > JMP                                                      ->13
         23    >   FE_FREE                                                  $12
   11    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.57 ms | 1395 KiB | 15 Q