3v4l.org

run code in 300+ PHP versions simultaneously
<?php class coche{ public $marca; public $modelo; public $color; function __construct(string $marca = " - ", int $modelo = 0, float $color = 0.0){ $this->marca = $marca; $this->modelo = $modelo; $this->color = $color; /* if(is_int($modelo)){ $this->modelo = $modelo; } else { throw new Exception('[ERROR #15] El segundo parametro tiene que ser entero'); } $this->modelo = is_int($modelo) ? $modelo: null; $this->color = is_float($color) ? $color: 0.0; */ } } $coche = new Coche("a",2,0.3); echo "\n".$coche->marca; echo "\n".$coche->modelo; echo "\n".$coche->color; //echo "\n".is_float(0.1); // var_dump($coche); $var = false ? "es verdadero": "es falso"; echo "\n".$var; $frutas = ["manzana", "pera", "uva", "guineo", "mango", "guayava"]; $i=1; $modulo = 2; do{ echo "\nla ".$frutas[$i]." está muy buena"; if($modulo % $i==0){ echo "\n es un numero par"; } ++$i; }while($i<count($frutas)); //$i<count($frutas)
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 28
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 36
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
Branch analysis from position: 36
filename:       /in/uEPXc
function name:  (null)
number of ops:  41
compiled vars:  !0 = $coche, !1 = $var, !2 = $frutas, !3 = $i, !4 = $modulo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $5      'Coche'
          1        SEND_VAL_EX                                              'a'
          2        SEND_VAL_EX                                              2
          3        SEND_VAL_EX                                              0.3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $5
   24     6        FETCH_OBJ_R                                      ~8      !0, 'marca'
          7        CONCAT                                           ~9      '%0A', ~8
          8        ECHO                                                     ~9
   25     9        FETCH_OBJ_R                                      ~10     !0, 'modelo'
         10        CONCAT                                           ~11     '%0A', ~10
         11        ECHO                                                     ~11
   26    12        FETCH_OBJ_R                                      ~12     !0, 'color'
         13        CONCAT                                           ~13     '%0A', ~12
         14        ECHO                                                     ~13
   29    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   30    18      > JMPZ                                                     <false>, ->21
         19    >   QM_ASSIGN                                        ~15     'es+verdadero'
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~15     'es+falso'
         22    >   ASSIGN                                                   !1, ~15
   31    23        CONCAT                                           ~17     '%0A', !1
         24        ECHO                                                     ~17
   33    25        ASSIGN                                                   !2, <array>
   34    26        ASSIGN                                                   !3, 1
   35    27        ASSIGN                                                   !4, 2
   37    28    >   FETCH_DIM_R                                      ~21     !2, !3
         29        CONCAT                                           ~22     '%0Ala+', ~21
         30        CONCAT                                           ~23     ~22, '+est%C3%A1+muy+buena'
         31        ECHO                                                     ~23
   38    32        MOD                                              ~24     !4, !3
         33        IS_EQUAL                                                 ~24, 0
         34      > JMPZ                                                     ~25, ->36
         35    >   ECHO                                                     '%0A+es+un+numero+par'
   39    36    >   PRE_INC                                                  !3
   40    37        COUNT                                            ~27     !2
         38        IS_SMALLER                                               !3, ~27
         39      > JMPNZ                                                    ~28, ->28
         40    > > RETURN                                                   1

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

End of function __construct

End of class coche.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.12 ms | 1400 KiB | 15 Q