3v4l.org

run code in 300+ PHP versions simultaneously
<?php class _ { private function __destruct() {new self;} } class __ { private $f; public function __construct(&$f) { $this->f = &$f; } public function __destruct() { $this->f = function(){new _;}; } } $f = function () use (&$f) { $t = new __($f); echo "All is good"; }; $f(); $f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/puQYJ
function name:  (null)
number of ops:  8
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpuQYJ%3A22%241'
          1        BIND_LEXICAL                                             ~1, !0
          2        ASSIGN                                                   !0, ~1
   28     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   29     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FpuQYJ%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/puQYJ
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $0      '_'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpuQYJ%3A18%240

Function %00%7Bclosure%7D%2Fin%2FpuQYJ%3A22%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/puQYJ
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $f, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   BIND_STATIC                                              !0
   24     1        NEW                                              $2      '__'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   25     5        ECHO                                                     'All+is+good'
   26     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FpuQYJ%3A22%241

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

End of function __destruct

End of class _.

Class __:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/puQYJ
function name:  __construct
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ_REF                                           'f'
          2        OP_DATA                                                  !0
   14     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/puQYJ
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpuQYJ%3A18%240'
          1        ASSIGN_OBJ                                               'f'
          2        OP_DATA                                                  ~1
   19     3      > RETURN                                                   null

End of function __destruct

End of class __.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.81 ms | 1390 KiB | 13 Q