3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Name_space; call_user_func(function () {var_dump(__FUNCTION__, __METHOD__);}); class Foo { public static function bar () { return new \ReflectionMethod(__CLASS__, __FUNCTION__); call_user_func(function () {var_dump(__FUNCTION__, __METHOD__);}); return new \ReflectionFunction(function () {}); } } var_dump(Foo::bar()->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6vId
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_NS_FCALL_BY_NAME                                    'Name_space%5Ccall_user_func'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A4%240'
          2        SEND_VAL_EX                                              ~0
          3        DO_FCALL                                      0          
   14     4        INIT_NS_FCALL_BY_NAME                                    'Name_space%5Cvar_dump'
          5        INIT_STATIC_METHOD_CALL                                  'Name_space%5CFoo', 'bar'
          6        DO_FCALL                                      0  $2      
          7        INIT_METHOD_CALL                                         $2, 'getName'
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR_NO_REF_EX                                       $3
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function %00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6vId
function name:  Name_space\{closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_NS_FCALL_BY_NAME                                    'Name_space%5Cvar_dump'
          1        SEND_VAL_EX                                              'Name_space%5C%7Bclosure%7D'
          2        SEND_VAL_EX                                              'Name_space%5C%7Bclosure%7D'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null

End of function %00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A4%240

Function %00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6vId
function name:  Name_space\{closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_NS_FCALL_BY_NAME                                    'Name_space%5Cvar_dump'
          1        SEND_VAL_EX                                              'Name_space%5C%7Bclosure%7D'
          2        SEND_VAL_EX                                              'Name_space%5C%7Bclosure%7D'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null

End of function %00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A9%241

Function %00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A10%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6vId
function name:  Name_space\{closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function %00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A10%242

Class Name_space\Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f6vId
function name:  bar
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $0      'ReflectionMethod'
          1        SEND_VAL_EX                                              'Name_space%5CFoo'
          2        SEND_VAL_EX                                              'bar'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $0
    9     5*       INIT_NS_FCALL_BY_NAME                                    'Name_space%5Ccall_user_func'
          6*       DECLARE_LAMBDA_FUNCTION                                  '%00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A9%241'
          7*       SEND_VAL_EX                                              ~2
          8*       DO_FCALL                                      0          
   10     9*       NEW                                              $4      'ReflectionFunction'
         10*       DECLARE_LAMBDA_FUNCTION                                  '%00name_space%5C%7Bclosure%7D%2Fin%2Ff6vId%3A10%242'
         11*       SEND_VAL_EX                                              ~5
         12*       DO_FCALL                                      0          
         13*       RETURN                                                   $4
   11    14*     > RETURN                                                   null

End of function bar

End of class Name_space\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.74 ms | 1400 KiB | 17 Q