3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Xpto{ public $someArray = array(); public function __set($parameter, $value) { $this->someArray[$parameter] = $value; } public function __get($parameter) { return $this->someArray[$parameter]; } } $class = new Xpto(); $class->test = "uma variavel com test\n"; echo $class->test; print_r( $class->someArray );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8jZ7R
function name:  (null)
number of ops:  12
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Xpto'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        ASSIGN_OBJ                                               !0, 'test'
          4        OP_DATA                                                  'uma+variavel+com+test%0A'
   24     5        FETCH_OBJ_R                                      ~5      !0, 'test'
          6        ECHO                                                     ~5
   26     7        INIT_FCALL                                               'print_r'
          8        FETCH_OBJ_R                                      ~6      !0, 'someArray'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class Xpto:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8jZ7R
function name:  __set
number of ops:  6
compiled vars:  !0 = $parameter, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        FETCH_OBJ_W                                      $2      'someArray'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
    9     5      > 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/8jZ7R
function name:  __get
number of ops:  5
compiled vars:  !0 = $parameter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~1      'someArray'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   14     4*     > RETURN                                                   null

End of function __get

End of class Xpto.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.46 ms | 1396 KiB | 15 Q