3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private $msg; public function test($msg) { $this->msg = $msg; } public function shout() { echo $this->msg; } } class Foo { private $bar; public function __construct($bar) { $this->bar = $bar; } public function say($msg) { $bar = $this->bar; $bar->test($msg); $this->bar->shout(); } } $test_me = new Foo(new Bar); $test_me->say('ha ha');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sGbe9
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test_me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'Foo'
          1        NEW                                              $2      'Bar'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   34     6        INIT_METHOD_CALL                                         !0, 'say'
          7        SEND_VAL_EX                                              'ha+ha'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Bar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sGbe9
function name:  test
number of ops:  4
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'msg'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function test

Function shout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sGbe9
function name:  shout
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'msg'
          1        ECHO                                                     ~0
   13     2      > RETURN                                                   null

End of function shout

End of class Bar.

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sGbe9
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
   23     3      > RETURN                                                   null

End of function __construct

Function say:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sGbe9
function name:  say
number of ops:  10
compiled vars:  !0 = $msg, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        FETCH_OBJ_R                                      ~2      'bar'
          2        ASSIGN                                                   !1, ~2
   27     3        INIT_METHOD_CALL                                         !1, 'test'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   28     6        FETCH_OBJ_R                                      ~5      'bar'
          7        INIT_METHOD_CALL                                         ~5, 'shout'
          8        DO_FCALL                                      0          
   29     9      > RETURN                                                   null

End of function say

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.81 ms | 1447 KiB | 13 Q