3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $f; public function __construct(&$f) { $this->f = &$f; } public function __destruct() { $this->f = "Some random string"; } } $f = function () use (&$f) { $t = new test($f); print "after this parent $f shouldn't be a closure anymore...\n"; }; $f(); var_dump($f);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/086V1
function name:  (null)
number of ops:  9
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F086V1%3A15%240'
          1        BIND_LEXICAL                                             ~1, !0
          2        ASSIGN                                                   !0, ~1
   20     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   22     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F086V1%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/086V1
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $f, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_STATIC                                              !0
   16     1        NEW                                              $2      'test'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   17     5        ROPE_INIT                                     3  ~6      'after+this+parent+'
          6        ROPE_ADD                                      1  ~6      ~6, !0
          7        ROPE_END                                      2  ~5      ~6, '+shouldn%27t+be+a+closure+anymore...%0A'
          8        ECHO                                                     ~5
   18     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F086V1%3A15%240

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/086V1
function name:  __construct
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ_REF                                           'f'
          2        OP_DATA                                                  !0
    8     3      > 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/086V1
function name:  __destruct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN_OBJ                                               'f'
          1        OP_DATA                                                  'Some+random+string'
   12     2      > RETURN                                                   null

End of function __destruct

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.31 ms | 1396 KiB | 15 Q