3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static function testprivate() { return 1; } public static function test() { return function() { return self::testprivate(); }; } } class B extends A { } $fn = B::test(); echo $fn();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WSIu7
function name:  (null)
number of ops:  7
compiled vars:  !0 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   18     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0  $3      
          5        ECHO                                                     $3
          6      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FWSIu7%3A8%240

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

End of function testprivate

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

End of function test

End of class A.

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

End of function testprivate

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

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.09 ms | 1399 KiB | 13 Q