3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Animal { private $color = 'no color'; public function setColor($color) { $this->color = $color; } public function printColor() { print $this->color . PHP_EOL; } } $redThing = new Animal; $redThing->printColor(); $redThing->setColor('red'); $redThing->printColor();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mLGWf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $redThing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Animal'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'printColor'
          4        DO_FCALL                                      0          
   25     5        INIT_METHOD_CALL                                         !0, 'setColor'
          6        SEND_VAL_EX                                              'red'
          7        DO_FCALL                                      0          
   27     8        INIT_METHOD_CALL                                         !0, 'printColor'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

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

End of function setcolor

Function printcolor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mLGWf
function name:  printColor
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'color'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   17     3      > RETURN                                                   null

End of function printcolor

End of class Animal.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.04 ms | 1394 KiB | 13 Q