3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function x() { return 'x'; } public function y() { return (function() { return $this->x(); })(); } } $test = new Test(); echo $test->y();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jMlo3
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        INIT_METHOD_CALL                                         !0, 'y'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FjMlo3%3A4%240

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

End of function x

Function y:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jMlo3
function name:  y
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FjMlo3%3A4%240'
          1        INIT_DYNAMIC_CALL                                        ~0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
          4*     > RETURN                                                   null

End of function y

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.68 ms | 1395 KiB | 13 Q