3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $val = 'Foo'; public static function huh() { $call = get_called_class().'::$val'; echo $call; } } class Bar extends Foo { public static $val = 'bar'; } Foo::huh(); Bar::huh();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2rUj
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'huh'
          1        DO_FCALL                                      0          
   14     2        INIT_STATIC_METHOD_CALL                                  'Bar', 'huh'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class Foo:
Function huh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2rUj
function name:  huh
number of ops:  5
compiled vars:  !0 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~1      
          1        CONCAT                                           ~2      ~1, '%3A%3A%24val'
          2        ASSIGN                                                   !0, ~2
    6     3        ECHO                                                     !0
    7     4      > RETURN                                                   null

End of function huh

End of class Foo.

Class Bar:
Function huh:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2rUj
function name:  huh
number of ops:  5
compiled vars:  !0 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~1      
          1        CONCAT                                           ~2      ~1, '%3A%3A%24val'
          2        ASSIGN                                                   !0, ~2
    6     3        ECHO                                                     !0
    7     4      > RETURN                                                   null

End of function huh

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.68 ms | 1393 KiB | 13 Q