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; throw new Exception("what?"); } public function __destruct() { echo "called\n"; } } try { $x = new A(); } catch(Exception $e) { } var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
filename:       /in/8WT4c
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $x, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
   18     1        NEW                                              $4      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
          4      > JMP                                                      ->6
   20     5  E > > CATCH                                       last         'Exception'
   24     6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/8WT4c
function name:  __construct
number of ops:  10
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
    9     5        NEW                                              $4      'Exception'
          6        SEND_VAL_EX                                              'what%3F'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $4
   10     9*     > 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/8WT4c
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'called%0A'
   14     1      > RETURN                                                   null

End of function __destruct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.99 ms | 1396 KiB | 15 Q