3v4l.org

run code in 200+ PHP versions simultaneously
<?php function foo(iterable $bar = null) { } foo(array()); foo(null);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
Output for branch php-master+opcache
Output for branch php-master+jit
Output for Typed properties v2
Output for Arrow functions
Output for Object typehint
Output for Array change keys
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be an instance of iterable, array given, called in /in/iShXW on line 7 and defined in /in/iShXW:3 Stack trace: #0 /in/iShXW(7): foo(Array) #1 {main} thrown in /in/iShXW on line 3
Process exited with code 255.
Output for Lexical anon
Catchable fatal error: Argument 1 passed to foo() must be an instance of iterable, array given, called in /in/iShXW on line 7 and defined in /in/iShXW on line 3
Process exited with code 255.

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