3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $resource; private $state = 'stable'; public function runBar() { try { $this->bar(); } catch (\Exception $e) { // Instead of trying to make this object stable again, just.. yield; } } private function bar() { $this->state = 'unstable'; $this->resource = 'Some external service'; throw new \Exception('Something went wrong with our resource, we\'re now in an unstable state'); } } $foo = new Foo(); $foo->runBar(); var_dump($foo);
Output for git.master, git.master_jit, rfc.property-hooks
object(Foo)#1 (2) { ["resource":"Foo":private]=> NULL ["state":"Foo":private]=> string(6) "stable" }

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