3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { public function startOn() { echo "Brrrr"; } } class Car { private $model; public function __construct($model) { $this->model = $model; } public function doFoo() { $this->model->startOn(); } } $gallardo = new Model; $gallardocar = new Car($gallardo); $gallardocar->doFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sXFjt
function name:  (null)
number of ops:  10
compiled vars:  !0 = $gallardo, !1 = $gallardocar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Model'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        NEW                                              $5      'Car'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   20     7        INIT_METHOD_CALL                                         !1, 'doFoo'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Model:
Function starton:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sXFjt
function name:  startOn
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'Brrrr'
    5     1      > RETURN                                                   null

End of function starton

End of class Model.

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

End of function __construct

Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sXFjt
function name:  doFoo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'model'
          1        INIT_METHOD_CALL                                         ~0, 'startOn'
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   null

End of function dofoo

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.49 ms | 1386 KiB | 13 Q