3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Result { private final function __construct() { } public static function success() { return new Success(); } public static function failure() { return new Failure(); } } final class Success extends Result { public static function fakeIt() { return new self(); } } final class Failure extends Result { } final class Fake extends Result { function Fake() {echo 'wtf';} } var_dump(Result::success()); var_dump(Result::failure()); var_dump(new Fake());
Output for rfc.property-hooks, git.master, git.master_jit
object(Success)#1 (0) { } object(Failure)#1 (0) { } Fatal error: Uncaught Error: Call to private Result::__construct() from global scope in /in/HdA1u:40 Stack trace: #0 {main} thrown in /in/HdA1u on line 40
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:
44.26 ms | 2179 KiB | 4 Q