3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace X { class Xx { public function get() { return function () { return new Yy(5); }; } } class Yy { public function __construct($a) { var_dump($a); } } } namespace Z { class Zz { public function get() { $x = new \X\Xx(); $f = $x->get(); $f(); } } (new Zz())->get(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2f63W
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $0      'Z%5CZz'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'get'
          3        DO_FCALL                                      0          
   37     4      > RETURN                                                   1

Function %00x%5C%7Bclosure%7D%2Fin%2F2f63W%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2f63W
function name:  X\{closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $0      'X%5CYy'
          1        SEND_VAL_EX                                              5
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $0
   10     4*     > RETURN                                                   null

End of function %00x%5C%7Bclosure%7D%2Fin%2F2f63W%3A8%240

Class X\Xx:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2f63W
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00x%5C%7Bclosure%7D%2Fin%2F2f63W%3A8%240'
   10     1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function get

End of class X\Xx.

Class X\Yy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2f63W
function name:  __construct
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        INIT_NS_FCALL_BY_NAME                                    'X%5Cvar_dump'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   19     4      > RETURN                                                   null

End of function __construct

End of class X\Yy.

Class Z\Zz:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2f63W
function name:  get
number of ops:  9
compiled vars:  !0 = $x, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'X%5CXx'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   30     3        INIT_METHOD_CALL                                         !0, 'get'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   32     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
   33     8      > RETURN                                                   null

End of function get

End of class Z\Zz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.6 ms | 1400 KiB | 15 Q