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"); $Ryan->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 AsignardEdad($edad){ $this->edad = $edad; } function MostrarDatos(){ echo $this->nombre.' tiene '.$this->$edad.'\n'; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined method Usuario::AsignarEdad() in /in/9DjcQ:8 Stack trace: #0 {main} thrown in /in/9DjcQ on line 8
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
49.34 ms | 401 KiB | 8 Q