3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function say($x) { echo "I was told to say $x\n"; } } $foo = new foo(); function a($x) { global $foo; $foo->say($x); } function b($x) { $GLOBALS['foo']->say($x); } a("hiya"); b("howdy");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HMnWZ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_FCALL                                               'a'
          4        SEND_VAL                                                 'hiya'
          5        DO_FCALL                                      0          
   20     6        INIT_FCALL                                               'b'
          7        SEND_VAL                                                 'howdy'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HMnWZ
function name:  a
number of ops:  6
compiled vars:  !0 = $x, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        BIND_GLOBAL                                              !1, 'foo'
   12     2        INIT_METHOD_CALL                                         !1, 'say'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   13     5      > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HMnWZ
function name:  b
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        FETCH_R                      global              ~1      'GLOBALS'
          2        FETCH_DIM_R                                      ~2      ~1, 'foo'
          3        INIT_METHOD_CALL                                         ~2, 'say'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   17     6      > RETURN                                                   null

End of function b

Class foo:
Function say:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HMnWZ
function name:  say
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ROPE_INIT                                     3  ~2      'I+was+told+to+say+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    5     5      > RETURN                                                   null

End of function say

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.78 ms | 1399 KiB | 15 Q