3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function y() { print "y".PHP_EOL; } static private function z() { print "z".PHP_EOL; } function x() { return function() { $this->y(); self::z(); }; } } $class = new A(); $closure = $class->x(); $closure();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cEuh0
function name:  (null)
number of ops:  9
compiled vars:  !0 = $class, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   28     3        INIT_METHOD_CALL                                         !0, 'x'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   30     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

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

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

End of function y

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

End of function z

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

End of function x

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.23 ms | 1395 KiB | 13 Q