3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo extends DateTime { public function __construct($time = null) { $tz = new DateTimeZone('UTC'); try { echo "First try\n"; parent::__construct($time, $tz); return; } catch (Exception $e) { echo "Second try\n"; parent::__construct($time.'C', $tz); } } } $date = '12 Sep 2007 15:49:12 UT'; var_dump(new Foo($date));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGnD2
function name:  (null)
number of ops:  8
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, '12+Sep+2007+15%3A49%3A12+UT'
   17     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $2      'Foo'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGnD2
function name:  __construct
number of ops:  20
compiled vars:  !0 = $time, !1 = $tz, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        NEW                                              $3      'DateTimeZone'
          2        SEND_VAL_EX                                              'UTC'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    7     5        ECHO                                                     'First+try%0A'
    8     6        INIT_STATIC_METHOD_CALL                                  
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
    9    10      > RETURN                                                   null
         11*       JMP                                                      ->19
   10    12  E > > CATCH                                       last         'Exception'
   11    13    >   ECHO                                                     'Second+try%0A'
   12    14        INIT_STATIC_METHOD_CALL                                  
         15        CONCAT                                           ~7      !0, 'C'
         16        SEND_VAL_EX                                              ~7
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0          
   14    19      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.82 ms | 1396 KiB | 15 Q