3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NS { class A { function test() { echo 'test'; } } } namespace NS2 { class_alias( 'NS\A', 'B' ); } namespace NS3 { class MyClass extends \B { function test() { echo 'test under MyClass'; } } } namespace NS4 { function foo (B $f) { $f->test(); } foo (new MyClass); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7u2is
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_NS_FCALL_BY_NAME                                    'NS2%5Cclass_alias'
          1        SEND_VAL_EX                                              'NS%5CA'
          2        SEND_VAL_EX                                              'B'
          3        DO_FCALL                                      0          
   15     4        DECLARE_CLASS                                            'ns3%5Cmyclass', 'b'
   27     5        INIT_NS_FCALL_BY_NAME                                    'NS4%5Cfoo'
          6        NEW                                              $1      'NS4%5CMyClass'
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $1
          9        DO_FCALL                                      0          
   29    10      > RETURN                                                   1

Function ns4%5Cfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7u2is
function name:  NS4\foo
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        INIT_METHOD_CALL                                         !0, 'test'
          2        DO_FCALL                                      0          
   25     3      > RETURN                                                   null

End of function ns4%5Cfoo

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

End of function test

End of class NS\A.

Class NS3\MyClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7u2is
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'test+under+MyClass'
          1      > RETURN                                                   null

End of function test

End of class NS3\MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.33 ms | 1399 KiB | 16 Q