3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bla { private $name; function __construct() { $this->name = 'I am this'; echo "We are in\n"; } function dontTouchThis() { return 'not this'; } function touchThis() { return $this->name; } } $lazyBla = (new \ReflectionClass('bla'))->newLazyProxy(function () { return new bla(); }); $whatsThat = $lazyBla->dontTouchThis(); echo $whatsThat . "\n\n"; $whatsThis = $lazyBla->touchThis(); echo $whatsThis . "\n\n"; $bla = new bla;
Output for git.master_jit, git.master
not this We are in I am this We are in

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:
27.82 ms | 405 KiB | 5 Q