3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rec['birthday']= "03/11"; $dates = explode("/",$rec['birthday']); if(!isset($dates[2])) $dates[2] = "0000"; $newdate = $dates[0]."-".$dates[1]."-".$dates[2]; echo $newdate;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/T2iGK
function name:  (null)
number of ops:  23
compiled vars:  !0 = $rec, !1 = $dates, !2 = $newdate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 'birthday'
          1        OP_DATA                                                  '03%2F11'
    3     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2F'
          4        FETCH_DIM_R                                      ~4      !0, 'birthday'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    4     8        ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !1, 2
          9        BOOL_NOT                                         ~8      ~7
         10      > JMPZ                                                     ~8, ->13
    5    11    >   ASSIGN_DIM                                               !1, 2
         12        OP_DATA                                                  '0000'
    6    13    >   FETCH_DIM_R                                      ~10     !1, 0
         14        CONCAT                                           ~11     ~10, '-'
         15        FETCH_DIM_R                                      ~12     !1, 1
         16        CONCAT                                           ~13     ~11, ~12
         17        CONCAT                                           ~14     ~13, '-'
         18        FETCH_DIM_R                                      ~15     !1, 2
         19        CONCAT                                           ~16     ~14, ~15
         20        ASSIGN                                                   !2, ~16
    7    21        ECHO                                                     !2
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.98 ms | 1395 KiB | 15 Q