3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function __construct() { $a = function() { echo $this->getId(); }; echo $a; } public function getId() { return 'id'; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKaji
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGKaji%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKaji
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'getId'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   10     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGKaji%3A7%240

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKaji
function name:  __construct
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGKaji%3A7%240'
          1        ASSIGN                                                   !0, ~1
   12     2        ECHO                                                     !0
   13     3      > RETURN                                                   null

End of function __construct

Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKaji
function name:  getId
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   'id'
   18     1*     > RETURN                                                   null

End of function getid

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1385 KiB | 13 Q