3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_data_ita($date) { if ($date == "") return ""; If(strtotime($date) !== False){ $d = new DateTime($date); }Else{ $d = DateTime::createFromFormat('d/m/Y', $date); } return $d->format('d/m/Y'); } echo get_data_ita("30/12/2017"); echo get_data_ita("2017-12-31 14:00:00");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kt5Vg
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'get_data_ita'
          1        SEND_VAL                                                 '30%2F12%2F2017'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   17     4        INIT_FCALL                                               'get_data_ita'
          5        SEND_VAL                                                 '2017-12-31+14%3A00%3A00'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Function get_data_ita:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kt5Vg
function name:  get_data_ita
number of ops:  24
compiled vars:  !0 = $date, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                                 !0, ''
          2      > JMPZ                                                     ~2, ->4
    5     3    > > RETURN                                                   ''
    7     4    >   INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        TYPE_CHECK                                  1018          $3
          8      > JMPZ                                                     ~4, ->14
    8     9    >   NEW                                              $5      'DateTime'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $5
    7    13      > JMP                                                      ->19
   10    14    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         15        SEND_VAL                                                 'd%2Fm%2FY'
         16        SEND_VAR                                                 !0
         17        DO_FCALL                                      0  $8      
         18        ASSIGN                                                   !1, $8
   12    19    >   INIT_METHOD_CALL                                         !1, 'format'
         20        SEND_VAL_EX                                              'd%2Fm%2FY'
         21        DO_FCALL                                      0  $10     
         22      > RETURN                                                   $10
   14    23*     > RETURN                                                   null

End of function get_data_ita

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.86 ms | 1001 KiB | 16 Q