3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace One { trait foo { static $bar = []; public static function a() { echo "Hello World"; } } } namespace Two { use One\foo as OneFoo; trait foo { use OneFoo; public static function a() { self::$bar = ["foo"]; echo "Goodbye Moon"; } } } namespace Three { class qux { use \One\foo; public static function a() { \Two\foo::a(); } } class bing extends qux { use \Two\foo; public static function a() { \Two\foo::a(); var_dump(self::$bar); } } } namespace { \Three\bing::a(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fv5iY
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'two%5Cfoo'
   27     1        DECLARE_CLASS                                            'three%5Cqux'
   35     2        DECLARE_CLASS                                            'three%5Cbing', 'three%5Cqux'
   46     3        INIT_STATIC_METHOD_CALL                                  'Three%5Cbing', 'a'
          4        DO_FCALL                                      0          
   47     5      > RETURN                                                   1

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

End of function a

End of class One\foo.

Class Two\foo:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fv5iY
function name:  a
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN_STATIC_PROP                                       'bar'
          1        OP_DATA                                                  <array>
   21     2        ECHO                                                     'Goodbye+Moon'
   22     3      > RETURN                                                   null

End of function a

End of class Two\foo.

Class Three\qux:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fv5iY
function name:  a
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                  'Two%5Cfoo', 'a'
          1        DO_FCALL                                      0          
   32     2      > RETURN                                                   null

End of function a

End of class Three\qux.

Class Three\bing:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fv5iY
function name:  a
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   INIT_STATIC_METHOD_CALL                                  'Two%5Cfoo', 'a'
          1        DO_FCALL                                      0          
   40     2        INIT_NS_FCALL_BY_NAME                                    'Three%5Cvar_dump'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_STATIC_PROP_FUNC_ARG   unknown             $1      'bar'
          5        SEND_FUNC_ARG                                            $1
          6        DO_FCALL                                      0          
   41     7      > RETURN                                                   null

End of function a

End of class Three\bing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.41 ms | 1396 KiB | 15 Q