3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func(string $foo){ } try { func(null); } catch (Error $e){ echo $e->getMessage()."\n"; } try { func(array()); } catch (Error $e){ echo $e->getMessage()."\n"; } try { func((object)array()); } catch (Error $e){ echo $e->getMessage()."\n"; } try { func(fopen("php://stdout", "w")); } catch (Error $e){ echo $e->getMessage()."\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
func(): Argument #1 ($foo) must be of type string, null given, called in /in/WZdQC on line 8 func(): Argument #1 ($foo) must be of type string, array given, called in /in/WZdQC on line 14 func(): Argument #1 ($foo) must be of type string, stdClass given, called in /in/WZdQC on line 20 func(): Argument #1 ($foo) must be of type string, resource given, called in /in/WZdQC on line 26

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:
27.76 ms | 406 KiB | 5 Q