3v4l.org

run code in 300+ PHP versions simultaneously
<?php function demo( MissingClass|string $e ) { echo $e; } function demo2(): MissingClass|string { return "Or here\n"; } class WithProp { public MissingClass|string $val; public function __construct() { $this->val = "Or here either\n"; } } demo( "No errors here\n" ); print( demo2() ); $d = new WithProp(); echo $d->val;
Output for git.master_jit, git.master
No errors here Or here Or here either

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.94 ms | 405 KiB | 5 Q