3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.34 ms | 2228 KiB | 15 Q