3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __destruct() { echo new Exception(); } } function bar1() { $a = new Foo; $a = null; } function bar2() { $a = new Foo; $b = $a; $a = null; } bar1(); bar2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VP5IJ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                                   'bar1'
          1        DO_FCALL                                          0          
   21     2        INIT_FCALL                                                   'bar2'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Function bar1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VP5IJ
function name:  bar1
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   11     3        ASSIGN                                                       !0, null
   12     4      > RETURN                                                       null

End of function bar1

Function bar2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VP5IJ
function name:  bar2
number of ops:  6
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $2      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   16     3        ASSIGN                                                       !1, !0
   17     4        ASSIGN                                                       !0, null
   18     5      > RETURN                                                       null

End of function bar2

Class Foo:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VP5IJ
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   NEW                                                  $0      'Exception'
          1        DO_FCALL                                          0          
          2        ECHO                                                         $0
    6     3      > RETURN                                                       null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.7 ms | 1467 KiB | 15 Q