3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Hello \n"; class foo { protected $values = array(); public function __set($key, $value) { echo "Set:$key to $value \n"; $this->$key = $value; //$this->values[$key] = $value; } public function __get($key) { echo "Get:$key \n"; //return $this->values[$key]; return $this->$key; } } $foo = new foo(); $foo->bar = 'assigning bar'; echo $foo->bar; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HqDhf
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Hello+%0A'
   22     1        NEW                                              $1      'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        ASSIGN_OBJ                                               !0, 'bar'
          5        OP_DATA                                                  'assigning+bar'
   24     6        FETCH_OBJ_R                                      ~5      !0, 'bar'
          7        ECHO                                                     ~5
   27     8      > RETURN                                                   1

Class foo:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HqDhf
function name:  __set
number of ops:  11
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ROPE_INIT                                     5  ~3      'Set%3A'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '+to+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '+%0A'
          7        ECHO                                                     ~2
   11     8        ASSIGN_OBJ                                               !0
          9        OP_DATA                                                  !1
   13    10      > RETURN                                                   null

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HqDhf
function name:  __get
number of ops:  8
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ROPE_INIT                                     3  ~2      'Get%3A'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '+%0A'
          4        ECHO                                                     ~1
   18     5        FETCH_OBJ_R                                      ~4      !0
          6      > RETURN                                                   ~4
   19     7*     > RETURN                                                   null

End of function __get

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.68 ms | 1395 KiB | 13 Q