3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Vehiculo{ private $puerta; private $ruedas; public function __construct($puerta = 2, $ruedas = 2){ $this->puerta = $puerta; $this->ruedas = $ruedas; } public function __get($atributo){ return $this->$atributo; } public function __set($atributo, $valor){ if(property_exists($this, $atributo)) { $this->$atributo = $valor; } } } $coche = new Vehiculo; echo $coche->puerta=5; if(property_exists($coche, "ruedas")) { echo "\nexiste la propiedad puerta\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/fEUjp
function name:  (null)
number of ops:  13
compiled vars:  !0 = $coche
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Vehiculo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        ASSIGN_OBJ                                       ~4      !0, 'puerta'
          4        OP_DATA                                                  5
          5        ECHO                                                     ~4
   26     6        INIT_FCALL                                               'property_exists'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'ruedas'
          9        DO_ICALL                                         $5      
         10      > JMPZ                                                     $5, ->12
   27    11    >   ECHO                                                     '%0Aexiste+la+propiedad+puerta%0A'
   28    12    > > RETURN                                                   1

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

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fEUjp
function name:  __get
number of ops:  4
compiled vars:  !0 = $atributo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/fEUjp
function name:  __set
number of ops:  11
compiled vars:  !0 = $atributo, !1 = $valor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'property_exists'
          3        FETCH_THIS                                       ~2      
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->10
   17     8    >   ASSIGN_OBJ                                               !0
          9        OP_DATA                                                  !1
   19    10    > > RETURN                                                   null

End of function __set

End of class Vehiculo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1400 KiB | 15 Q