3v4l.org

run code in 500+ PHP versions simultaneously
<?php $now = new DateTime(); $formatted = ""; $arrFormattedBDays = []; $birthdays = ['18-Jul-46','19-Aug-47','1-Jan-19','31-Dec-18']; foreach ($birthdays as $b){ list($d,$m,$y) = explode("-",$b); $y = '19'.$y; $dt = new DateTime("$d-$m-$y"); $formatted = $dt->format('d/m/Y'); $arrFormattedBDays[] = $formatted; } var_dump($arrFormattedBDays);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 37
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 37
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/UepcO
function name:  (null)
number of ops:  42
compiled vars:  !0 = $now, !1 = $formatted, !2 = $arrFormattedBDays, !3 = $birthdays, !4 = $b, !5 = $d, !6 = $m, !7 = $y, !8 = $dt
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   NEW                                                  $9      'DateTime'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $9
    3     3        ASSIGN                                                       !1, ''
    4     4        ASSIGN                                                       !2, <array>
    5     5        ASSIGN                                                       !3, <array>
    6     6      > FE_RESET_R                                           $15     !3, ->37
          7    > > FE_FETCH_R                                                   $15, !4, ->37
    7     8    >   INIT_FCALL                                                   'explode'
          9        SEND_VAL                                                     '-'
         10        SEND_VAR                                                     !4
         11        DO_ICALL                                             $16     
         12        FETCH_LIST_R                                         $17     $16, 0
         13        ASSIGN                                                       !5, $17
         14        FETCH_LIST_R                                         $19     $16, 1
         15        ASSIGN                                                       !6, $19
         16        FETCH_LIST_R                                         $21     $16, 2
         17        ASSIGN                                                       !7, $21
         18        FREE                                                         $16
    8    19        CONCAT                                               ~23     '19', !7
         20        ASSIGN                                                       !7, ~23
    9    21        NEW                                                  $25     'DateTime'
         22        ROPE_INIT                                         5  ~27     !5
         23        ROPE_ADD                                          1  ~27     ~27, '-'
         24        ROPE_ADD                                          2  ~27     ~27, !6
         25        ROPE_ADD                                          3  ~27     ~27, '-'
         26        ROPE_END                                          4  ~26     ~27, !7
         27        SEND_VAL_EX                                                  ~26
         28        DO_FCALL                                          0          
         29        ASSIGN                                                       !8, $25
   10    30        INIT_METHOD_CALL                                             !8, 'format'
         31        SEND_VAL_EX                                                  'd%2Fm%2FY'
         32        DO_FCALL                                          0  $32     
         33        ASSIGN                                                       !1, $32
   11    34        ASSIGN_DIM                                                   !2
         35        OP_DATA                                                      !1
    6    36      > JMP                                                          ->7
         37    >   FE_FREE                                                      $15
   13    38        INIT_FCALL                                                   'var_dump'
         39        SEND_VAR                                                     !2
         40        DO_ICALL                                                     
         41      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.13 ms | 2502 KiB | 15 Q