3v4l.org

run code in 300+ PHP versions simultaneously
<?php //error_reporting(-1); class A { function B() { echo "instance method B\n"; } static function C() { echo "static method C\n"; } } $a = new A(); echo "Calling B statically referenced: "; $a::B(); echo "Calling C statically referenced: "; $a::C(); echo "Calling B statically: "; A::B(); echo "Calling C statically: "; A::C(); echo "Calling B instantiated: "; $a->B(); echo "Calling C instantiated: "; $a->C();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tuf1I
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        ECHO                                                     'Calling+B+statically+referenced%3A+'
   15     4        FETCH_CLASS                                   0  $4      !0
          5        INIT_STATIC_METHOD_CALL                                  $4, 'B'
          6        DO_FCALL                                      0          
   16     7        ECHO                                                     'Calling+C+statically+referenced%3A+'
   17     8        FETCH_CLASS                                   0  $6      !0
          9        INIT_STATIC_METHOD_CALL                                  $6, 'C'
         10        DO_FCALL                                      0          
   18    11        ECHO                                                     'Calling+B+statically%3A+'
   19    12        INIT_STATIC_METHOD_CALL                                  'A', 'B'
         13        DO_FCALL                                      0          
   20    14        ECHO                                                     'Calling+C+statically%3A+'
   21    15        INIT_STATIC_METHOD_CALL                                  'A', 'C'
         16        DO_FCALL                                      0          
   22    17        ECHO                                                     'Calling+B+instantiated%3A+'
   23    18        INIT_METHOD_CALL                                         !0, 'B'
         19        DO_FCALL                                      0          
   24    20        ECHO                                                     'Calling+C+instantiated%3A+'
   25    21        INIT_METHOD_CALL                                         !0, 'C'
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tuf1I
function name:  B
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'instance+method+B%0A'
    6     1      > RETURN                                                   null

End of function b

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tuf1I
function name:  C
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'static+method+C%0A'
   10     1      > RETURN                                                   null

End of function c

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.81 ms | 1386 KiB | 13 Q