3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); interface SafeC { /** @throws void */ function get(): null; } class C { /** * @throws \Exception */ function get(): int { return random_int(0, 2) > 0 ? 1 : throw new \Exception("oops"); } } class CSafe1 extends C implements SafeC {}; class CSafe2 extends C implements SafeC { function get(): never { throw new \Exception("oops"); } };
Output for rfc.property-hooks
Fatal error: Declaration of C::get(): int must be compatible with SafeC::get(): null in /in/sO1AE on line 12
Process exited with code 255.
Output for git.master_jit, git.master
Fatal error: Declaration of C::get(): int must be compatible with SafeC::get(): null in /in/sO1AE on line 12 Stack trace: #0 {main}
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:
51.59 ms | 2741 KiB | 4 Q