3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Derp; abstract class A { public $stuff = array(); abstract public function __construct(); } class B extends A { protected $kids; protected $log; public function __construct() { } public function bee() { $this->kids = new C($this); $this->kids->cee(); echo "Buzz bee\n"; } public function updateLog($msg) { $this->log[] = $msg; echo "Adddig log $msg\n"; } } class C { public $Cups = "cCup"; public function __construct($b) { //$this->bee(); $this->Cups = $b; echo "Building c\n"; } public function cee() { $this->stuff = array("MyStuff"); $this->Cups->updateLog("This"); $this->Cups->updateLog("That"); echo "In cee\n"; } } $b = new B(); $x = $b->bee(); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  (null)
number of ops:  10
compiled vars:  !0 = $b, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   NEW                                              $2      'Derp%5CB'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   56     3        INIT_METHOD_CALL                                         !0, 'bee'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   58     6        INIT_NS_FCALL_BY_NAME                                    'Derp%5Cvar_dump'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Derp\A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function __construct

End of class Derp\A.

Class Derp\B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   null

End of function __construct

Function bee:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  bee
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Derp%5CC'
          1        FETCH_THIS                                       $2      
          2        SEND_VAR_EX                                              $2
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'kids'
          5        OP_DATA                                                  $1
   23     6        FETCH_OBJ_R                                      ~4      'kids'
          7        INIT_METHOD_CALL                                         ~4, 'cee'
          8        DO_FCALL                                      0          
   24     9        ECHO                                                     'Buzz+bee%0A'
   25    10      > RETURN                                                   null

End of function bee

Function updatelog:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  updateLog
number of ops:  9
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        FETCH_OBJ_W                                      $1      'log'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   30     4        ROPE_INIT                                     3  ~4      'Adddig+log+'
          5        ROPE_ADD                                      1  ~4      ~4, !0
          6        ROPE_END                                      2  ~3      ~4, '%0A'
          7        ECHO                                                     ~3
   31     8      > RETURN                                                   null

End of function updatelog

End of class Derp\B.

Class Derp\C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  __construct
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   40     1        ASSIGN_OBJ                                               'Cups'
          2        OP_DATA                                                  !0
   41     3        ECHO                                                     'Building+c%0A'
   42     4      > RETURN                                                   null

End of function __construct

Function cee:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dp9Pb
function name:  cee
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   ASSIGN_OBJ                                               'stuff'
          1        OP_DATA                                                  <array>
   48     2        FETCH_OBJ_R                                      ~1      'Cups'
          3        INIT_METHOD_CALL                                         ~1, 'updateLog'
          4        SEND_VAL_EX                                              'This'
          5        DO_FCALL                                      0          
   49     6        FETCH_OBJ_R                                      ~3      'Cups'
          7        INIT_METHOD_CALL                                         ~3, 'updateLog'
          8        SEND_VAL_EX                                              'That'
          9        DO_FCALL                                      0          
   50    10        ECHO                                                     'In+cee%0A'
   51    11      > RETURN                                                   null

End of function cee

End of class Derp\C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.63 ms | 1400 KiB | 15 Q