3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = null; class A extends DateTime { public function __construct($d, $a) { global $a; $a = $this; parent::__construct($d, $a); throw new Exception("what?"); } public function __destruct() { echo "called\n"; } } try { $x = new A(10, 20); } catch(Exception $e) { } var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
filename:       /in/niSX6
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $x, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
   19     1        NEW                                              $4      'A'
          2        SEND_VAL_EX                                              10
          3        SEND_VAL_EX                                              20
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
          6      > JMP                                                      ->8
   21     7  E > > CATCH                                       last         'Exception'
   25     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/niSX6
function name:  __construct
number of ops:  14
compiled vars:  !0 = $d, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        BIND_GLOBAL                                              !1, 'a'
    7     3        FETCH_THIS                                       ~2      
          4        ASSIGN                                                   !1, ~2
    8     5        INIT_STATIC_METHOD_CALL                                  
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   10     9        NEW                                              $5      'Exception'
         10        SEND_VAL_EX                                              'what%3F'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $5
   11    13*     > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/niSX6
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'called%0A'
   15     1      > RETURN                                                   null

End of function __destruct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.81 ms | 1388 KiB | 15 Q