3v4l.org

run code in 500+ PHP versions simultaneously
<?php class myclass { private $anotherProp='Another property value'; public function __set($prop,$val){ if(! property_exists($this,$prop) ){ $this->$prop=$val; echo $this->$prop; }else{ echo 'property already exists' . "\n"; } } } $obj=new myclass(); $obj->newProp='i am a new property' . "\n"; $obj->anotherProp='i am another property' . "\n"; var_dump($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uKQiH
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $1      'myclass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   18     3        ASSIGN_OBJ                                                   !0, 'newProp'
          4        OP_DATA                                                      'i+am+a+new+property%0A'
   19     5        ASSIGN_OBJ                                                   !0, 'anotherProp'
          6        OP_DATA                                                      'i+am+another+property%0A'
   21     7        INIT_FCALL                                                   'var_dump'
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

Class myclass:
Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uKQiH
function name:  __set
number of ops:  13
compiled vars:  !0 = $prop, !1 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    8     2        FETCH_THIS                                           ~2      
          3        FRAMELESS_ICALL_2                property_exists      ~3      ~2, !0
          4        BOOL_NOT                                             ~4      ~3
          5      > JMPZ                                                         ~4, ->11
    9     6    >   ASSIGN_OBJ                                                   !0
          7        OP_DATA                                                      !1
   10     8        FETCH_OBJ_R                                          ~6      !0
          9        ECHO                                                         ~6
    8    10      > JMP                                                          ->12
   12    11    >   ECHO                                                         'property+already+exists%0A'
   14    12    > > RETURN                                                       null

End of function __set

End of class myclass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.62 ms | 2868 KiB | 14 Q