3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __destruct() { static $i = 0; $i++; throw new Exception('Foo::__destruct() ' . $i); } } try { var_dump(new Foo() + new Foo()); } catch (Exception $e) { var_dump($e); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/um5TH
function name:  (null)
number of ops:  14
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $1      'Foo'
          2        DO_FCALL                                          0          
          3        NEW                                                  $3      'Foo'
          4        DO_FCALL                                          0          
          5        ADD                                                  ~5      $1, $3
          6        SEND_VAL                                                     ~5
          7        DO_ICALL                                                     
          8      > JMP                                                          ->13
   13     9  E > > CATCH                                           last         'Exception'
   14    10    >   INIT_FCALL                                                   'var_dump'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                                     
   15    13    > > RETURN                                                       1

Class Foo:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/um5TH
function name:  __destruct
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
    6     1        PRE_INC                                                      !0
    7     2        NEW                                                  $2      'Exception'
          3        CONCAT                                               ~3      'Foo%3A%3A__destruct%28%29+', !0
          4        SEND_VAL_EX                                                  ~3
          5        DO_FCALL                                          0          
          6      > THROW                                             0          $2
    8     7*     > RETURN                                                       null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
204.86 ms | 1970 KiB | 13 Q