3v4l.org

run code in 300+ PHP versions simultaneously
<?php $day = 10; $month = 12; $year = 88; $format = strlen($year) == 2 ? "y-m-d" : "Y-m-d"; $dt = date_create_from_format($format, $year.'-'.$month.'-'.$day)->format("Y-m-d"); print_r($dt);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2qnWS
function name:  (null)
number of ops:  26
compiled vars:  !0 = $day, !1 = $month, !2 = $year, !3 = $format, !4 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10
    4     1        ASSIGN                                                   !1, 12
    5     2        ASSIGN                                                   !2, 88
    7     3        STRLEN                                           ~8      !2
          4        IS_EQUAL                                                 ~8, 2
          5      > JMPZ                                                     ~9, ->8
          6    >   QM_ASSIGN                                        ~10     'y-m-d'
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~10     'Y-m-d'
          9    >   ASSIGN                                                   !3, ~10
    9    10        INIT_FCALL                                               'date_create_from_format'
         11        SEND_VAR                                                 !3
         12        CONCAT                                           ~12     !2, '-'
         13        CONCAT                                           ~13     ~12, !1
         14        CONCAT                                           ~14     ~13, '-'
         15        CONCAT                                           ~15     ~14, !0
         16        SEND_VAL                                                 ~15
         17        DO_ICALL                                         $16     
         18        INIT_METHOD_CALL                                         $16, 'format'
         19        SEND_VAL_EX                                              'Y-m-d'
         20        DO_FCALL                                      0  $17     
         21        ASSIGN                                                   !4, $17
   10    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.28 ms | 1400 KiB | 17 Q