3v4l.org

run code in 300+ PHP versions simultaneously
<?php class QueryHandler { public $input; public function render(Closure $query){ $this->input = "test"; $query(); } } class MyQuery{ public $handler; public function __construct(){ $this->handler = new QueryHandler; } public function query(){ return function () { echo $this->handler->input; }; } public function render(Closure $query){ $this->handler($query); } } echo "start"."\n"; $myQuery = new MyQuery; $myQuery->render();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJRvG
function name:  (null)
number of ops:  7
compiled vars:  !0 = $myQuery
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   ECHO                                                     'start%0A'
   42     1        NEW                                              $1      'MyQuery'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   43     4        INIT_METHOD_CALL                                         !0, 'render'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZJRvG%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJRvG
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'handler'
          2        FETCH_OBJ_R                                      ~2      ~1, 'input'
          3        ECHO                                                     ~2
   30     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZJRvG%3A26%240

Class QueryHandler:
Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJRvG
function name:  render
number of ops:  6
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'input'
          2        OP_DATA                                                  'test'
   10     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   11     5      > RETURN                                                   null

End of function render

End of class QueryHandler.

Class MyQuery:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJRvG
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'QueryHandler'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'handler'
          3        OP_DATA                                                  $1
   21     4      > RETURN                                                   null

End of function __construct

Function query:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJRvG
function name:  query
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZJRvG%3A26%240'
   30     1      > RETURN                                                   ~0
   32     2*     > RETURN                                                   null

End of function query

Function render:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZJRvG
function name:  render
number of ops:  5
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   35     1        INIT_METHOD_CALL                                         'handler'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   36     4      > RETURN                                                   null

End of function render

End of class MyQuery.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.1 ms | 1399 KiB | 13 Q