3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str_date = '12.31.2018'; try{ if($valid = (new \DateTime($str_date))){ echo $valid->getTimeStamp(); } } catch(Exception $e){ try { $str_date = (str_replace('.','/',$str_date)); if($valid = (new \DateTime($str_date))){ echo $valid->getTimeStamp(); } } catch(Exception $e){ echo $e->getMessage(); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Found catch point at position: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 25
Found catch point at position: 26
Branch analysis from position: 26
2 jumps found. (Code = 107) Position 1 = 27, Position 2 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t5klt
function name:  (null)
number of ops:  31
compiled vars:  !0 = $str_date, !1 = $valid, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '12.31.2018'
    6     1        NEW                                              $4      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                           ~6      !1, $4
          5      > JMPZ                                                     ~6, ->9
    7     6    >   INIT_METHOD_CALL                                         !1, 'getTimeStamp'
          7        DO_FCALL                                      0  $7      
          8        ECHO                                                     $7
          9    > > JMP                                                      ->30
    9    10  E > > CATCH                                       last         'Exception'
   11    11    >   INIT_FCALL                                               'str_replace'
         12        SEND_VAL                                                 '.'
         13        SEND_VAL                                                 '%2F'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !0, $8
   12    17        NEW                                              $10     'DateTime'
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0          
         20        ASSIGN                                           ~12     !1, $10
         21      > JMPZ                                                     ~12, ->25
   13    22    >   INIT_METHOD_CALL                                         !1, 'getTimeStamp'
         23        DO_FCALL                                      0  $13     
         24        ECHO                                                     $13
         25    > > JMP                                                      ->30
   15    26  E > > CATCH                                       last         'Exception'
   16    27    >   INIT_METHOD_CALL                                         !2, 'getMessage'
         28        DO_FCALL                                      0  $14     
         29        ECHO                                                     $14
   21    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.38 ms | 993 KiB | 14 Q