3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Fruit { public function __construct($name, $color) { $this->name = $name; $this->color = $color; } function get_name() { return $this->name; } function get_color() { return $this->color; } } $apple = new Fruit("Apple" , "red"); echo $apple->get_name(),PHP_EOL; echo PHP_EOL; echo $apple->get_color();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AdPkN
function name:  (null)
number of ops:  14
compiled vars:  !0 = $apple
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $1      'Fruit'
          1        SEND_VAL_EX                                                  'Apple'
          2        SEND_VAL_EX                                                  'red'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $1
   18     5        INIT_METHOD_CALL                                             !0, 'get_name'
          6        DO_FCALL                                          0  $4      
          7        ECHO                                                         $4
          8        ECHO                                                         '%0A'
   19     9        ECHO                                                         '%0A'
   20    10        INIT_METHOD_CALL                                             !0, 'get_color'
         11        DO_FCALL                                          0  $5      
         12        ECHO                                                         $5
         13      > RETURN                                                       1

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

End of function __construct

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

End of function get_name

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

End of function get_color

End of class Fruit.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.64 ms | 1723 KiB | 13 Q