3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Tmp { function __destruct() { var_dump("destroying"); } } $tmp = new Tmp(); $fn = function () { $tmp = 42; var_dump("closure executed"); }; var_dump("closure defined"); unset($tmp); var_dump("original var unset"); $fn();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fpjbX
function name:  (null)
number of ops:  15
compiled vars:  !0 = $tmp, !1 = $fn
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $2      'Tmp'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   11     3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        ASSIGN                                                       !1, ~5
   16     5        INIT_FCALL                                                   'var_dump'
          6        SEND_VAL                                                     'closure+defined'
          7        DO_ICALL                                                     
   17     8        UNSET_CV                                                     !0
   18     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAL                                                     'original+var+unset'
         11        DO_ICALL                                                     
   19    12        INIT_DYNAMIC_CALL                                            !1
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fpjbX
function name:  {closure:/in/fpjbX:11}
number of ops:  5
compiled vars:  !0 = $tmp
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                       !0, 42
   13     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAL                                                     'closure+executed'
          3        DO_ICALL                                                     
   14     4      > RETURN                                                       null

End of Dynamic Function 0

Class Tmp:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fpjbX
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                                   'var_dump'
          1        SEND_VAL                                                     'destroying'
          2        DO_ICALL                                                     
    6     3      > RETURN                                                       null

End of function __destruct

End of class Tmp.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.24 ms | 2011 KiB | 14 Q