3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A { class B { public function foo() {} } function test() { } } namespace { $ref = new \ReflectionFunction('A\B::foo'); var_dump($ref->getNamespaceName(), $ref->inNamespace()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4ATJr
function name:  (null)
number of ops:  13
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'ReflectionFunction'
          1        SEND_VAL_EX                                              'A%5CB%3A%3Afoo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   15     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'getNamespaceName'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        INIT_METHOD_CALL                                         !0, 'inNamespace'
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
   16    12      > RETURN                                                   1

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

End of function a%5Ctest

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

End of function foo

End of class A\B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
197.27 ms | 1395 KiB | 15 Q