3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Crear variable $Ryan y asignarle como valor la clase Usuario $Ryan = new Usuario(); // Ahora la variable Ryan es una clase, con variables $nombre y $edad $Ryan->AsignarNombre("Ryan"); $Ryan->AsignarEdad(19); //////////////////////////////////////////////// // Crear variable $Ismael y asignarle como valor la clase Usuario $Ismael = new Usuario(); // Ahora la variable Ismael es una clase, con variables $nombre y $edad $Ismael->AsignarNombre("Ismael"); $Ismael->AsignarEdad(21); ////////////////////// // Mostrar informacion de ryan $Ryan->MostrarDatos(); // Mostrar informacion de Ismael $Ismael->MostrarDatos(); Class Usuario{ public $nombre; public $edad; function AsignarNombre($nombre){ $this->nombre = $nombre; } function AsignarEdad($edad){ $this->edad = $edad; } function MostrarDatos(){ echo $this->nombre.' tiene '.$this->$edad.'\n'; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Kbvr
function name:  (null)
number of ops:  23
compiled vars:  !0 = $Ryan, !1 = $Ismael
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $2      'Usuario'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    7     3        INIT_METHOD_CALL                                         !0, 'AsignarNombre'
          4        SEND_VAL_EX                                              'Ryan'
          5        DO_FCALL                                      0          
    8     6        INIT_METHOD_CALL                                         !0, 'AsignarEdad'
          7        SEND_VAL_EX                                              19
          8        DO_FCALL                                      0          
   15     9        NEW                                              $7      'Usuario'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   18    12        INIT_METHOD_CALL                                         !1, 'AsignarNombre'
         13        SEND_VAL_EX                                              'Ismael'
         14        DO_FCALL                                      0          
   19    15        INIT_METHOD_CALL                                         !1, 'AsignarEdad'
         16        SEND_VAL_EX                                              21
         17        DO_FCALL                                      0          
   25    18        INIT_METHOD_CALL                                         !0, 'MostrarDatos'
         19        DO_FCALL                                      0          
   28    20        INIT_METHOD_CALL                                         !1, 'MostrarDatos'
         21        DO_FCALL                                      0          
   49    22      > RETURN                                                   1

Class Usuario:
Function asignarnombre:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Kbvr
function name:  AsignarNombre
number of ops:  4
compiled vars:  !0 = $nombre
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        ASSIGN_OBJ                                               'nombre'
          2        OP_DATA                                                  !0
   37     3      > RETURN                                                   null

End of function asignarnombre

Function asignaredad:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Kbvr
function name:  AsignarEdad
number of ops:  4
compiled vars:  !0 = $edad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
   40     1        ASSIGN_OBJ                                               'edad'
          2        OP_DATA                                                  !0
   41     3      > RETURN                                                   null

End of function asignaredad

Function mostrardatos:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Kbvr
function name:  MostrarDatos
number of ops:  7
compiled vars:  !0 = $edad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   FETCH_OBJ_R                                      ~1      'nombre'
          1        CONCAT                                           ~2      ~1, '+tiene+'
          2        FETCH_OBJ_R                                      ~3      !0
          3        CONCAT                                           ~4      ~2, ~3
          4        CONCAT                                           ~5      ~4, '%5Cn'
          5        ECHO                                                     ~5
   45     6      > RETURN                                                   null

End of function mostrardatos

End of class Usuario.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.31 ms | 1399 KiB | 13 Q