3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Collection { /** @var string */ private $type; /** * @param string $type */ public static function ofType($type) { $collection = new static(); $collection->type = $type; } } final class Person {} $col = Collection::ofType(Person::class); function parsePersonCollection(PersonCollection $coll) { } parsePersonCollection($col);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: parsePersonCollection(): Argument #1 ($coll) must be of type PersonCollection, null given, called in /in/rLP1E on line 26 and defined in /in/rLP1E:21 Stack trace: #0 /in/rLP1E(26): parsePersonCollection(NULL) #1 {main} thrown in /in/rLP1E on line 21
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:
53.32 ms | 401 KiB | 8 Q