3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Concrete5_Helper_Foo { public static function get() { return self::getFirstName(); } protected $firstName = 'James'; public static function getFirstName() { return $firstName; } } class Foo extends Concrete5_Helper_Foo { protected $firstName = 'Chris'; } var_dump(get_class(Concrete5_Helper_Foo::get())); var_dump(get_class(Foo::get())); var_dump(get_class(Foo::get()->getFirstName()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpMnF
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Concrete5_Helper_Foo', 'get'
          2        DO_FCALL                                      0  $0      
          3        GET_CLASS                                        ~1      $0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   26     6        INIT_FCALL                                               'var_dump'
          7        INIT_STATIC_METHOD_CALL                                  'Foo', 'get'
          8        DO_FCALL                                      0  $3      
          9        GET_CLASS                                        ~4      $3
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                                 
   27    12        INIT_FCALL                                               'var_dump'
         13        INIT_STATIC_METHOD_CALL                                  'Foo', 'get'
         14        DO_FCALL                                      0  $6      
         15        INIT_METHOD_CALL                                         $6, 'getFirstName'
         16        DO_FCALL                                      0  $7      
         17        GET_CLASS                                        ~8      $7
         18        SEND_VAL                                                 ~8
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class Concrete5_Helper_Foo:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpMnF
function name:  get
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'getFirstName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function get

Function getfirstname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpMnF
function name:  getFirstName
number of ops:  2
compiled vars:  !0 = $firstName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   !0
   14     1*     > RETURN                                                   null

End of function getfirstname

End of class Concrete5_Helper_Foo.

Class Foo:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpMnF
function name:  get
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'getFirstName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function get

Function getfirstname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZpMnF
function name:  getFirstName
number of ops:  2
compiled vars:  !0 = $firstName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   !0
   14     1*     > RETURN                                                   null

End of function getfirstname

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.17 ms | 1392 KiB | 15 Q