3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Articulo { public function __construct( public readonly string $id, private string $nombre, private float $precioBase ) {} public function getNombre(): string { return $this->nombre; } public function getPrecio(): float { return $this->precioBase; } public function modificarPrecio(float $nuevoPrecio): void { if ($nuevoPrecio <= 0) { throw new Exception("Error: El nuevo precio debe ser mayor a 0."); } $this->precioBase = $nuevoPrecio; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2XEjK
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E > > RETURN                                                       1

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

End of function __construct

Function getnombre:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2XEjK
function name:  getNombre
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                          ~0      'nombre'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   12     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function getnombre

Function getprecio:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2XEjK
function name:  getPrecio
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                          ~0      'precioBase'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   16     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function getprecio

Function modificarprecio:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2XEjK
function name:  modificarPrecio
number of ops:  10
compiled vars:  !0 = $nuevoPrecio
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   19     1        IS_SMALLER_OR_EQUAL                                          !0, 0
          2      > JMPZ                                                         ~1, ->7
   20     3    >   NEW                                                  $2      'Exception'
          4        SEND_VAL_EX                                                  'Error%3A+El+nuevo+precio+debe+ser+mayor+a+0.'
          5        DO_FCALL                                          0          
          6      > THROW                                             0          $2
   22     7    >   ASSIGN_OBJ                                                   'precioBase'
          8        OP_DATA                                                      !0
   23     9      > RETURN                                                       null

End of function modificarprecio

End of class Articulo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.04 ms | 1406 KiB | 13 Q