3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function foo($a = 1) { echo __METHOD__;} static function bar($a = 1) { echo __METHOD__;} } $x = new x(); $x->foo(); // classic method call $x::bar(); // static method call on object X::bar(); // static method call on class name ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NsId6
function name:  (null)
number of ops:  11
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
   11     5        FETCH_CLASS                                   0  $5      !0
          6        INIT_STATIC_METHOD_CALL                                  $5, 'bar'
          7        DO_FCALL                                      0          
   12     8        INIT_STATIC_METHOD_CALL                                  'X', 'bar'
          9        DO_FCALL                                      0          
   14    10      > RETURN                                                   1

Class x:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NsId6
function name:  foo
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      1
          1        ECHO                                                     'x%3A%3Afoo'
          2      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NsId6
function name:  bar
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      1
          1        ECHO                                                     'x%3A%3Abar'
          2      > RETURN                                                   null

End of function bar

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.91 ms | 1448 KiB | 13 Q