3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { public $myAge; public $myName; public $gender; public function __construct($myName, $myAge, $gender) { $this->firstname = $myName; $this->leeftijd = $myAge; $this->geslacht = $gender; } public function greet() { return "Hello my name is ".$this->firstname ."My age is ".$this->leeftijd ."dude!!!".geslacht; } } $me = new Person('martin', 28, 'man'); $me->greet(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Person::$firstname is deprecated in /in/EX0K4 on line 8 Deprecated: Creation of dynamic property Person::$leeftijd is deprecated in /in/EX0K4 on line 9 Deprecated: Creation of dynamic property Person::$geslacht is deprecated in /in/EX0K4 on line 10 Fatal error: Uncaught Error: Undefined constant "geslacht" in /in/EX0K4:14 Stack trace: #0 /in/EX0K4(18): Person->greet() #1 {main} thrown in /in/EX0K4 on line 14
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:
52.83 ms | 401 KiB | 8 Q