3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $x; private $y; public function __construct() { $this->x = 10; $this->y = function (){ return $this->getToutesLesCommandes();}; } public function getY() { return $this->$k; } public function getToutesLesCommandes() { //sleep(5); echo "Et 5 tres longues secondes plus tard..."; return array('commande1' => 123456, 'commande2' => 456789); } } $t = new Test(); //var_dump($t); var_dump($t->getY()); var_dump($t->getY());
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $k in /in/sTD4g on line 16 Warning: Undefined property: Test::$ in /in/sTD4g on line 16 NULL Warning: Undefined variable $k in /in/sTD4g on line 16 Warning: Undefined property: Test::$ in /in/sTD4g on line 16 NULL

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:
51.15 ms | 402 KiB | 8 Q