3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php f((double)5); function f(double $d){ var_dump($d); }

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
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7:3 Stack trace: #0 /in/4dGn7(2): f(5) #1 {main} thrown in /in/4dGn7 on line 3
Output for branch php-7.4
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7:3 Stack trace: #0 /in/4dGn7(2): f(5) #1 {main} thrown in /in/4dGn7 on line 3
Output for Typed properties v2
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7:3 Stack trace: #0 /in/4dGn7(2): f(5) #1 {main} thrown in /in/4dGn7 on line 3
Output for Arrow functions
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7:3 Stack trace: #0 /in/4dGn7(2): f(5) #1 {main} thrown in /in/4dGn7 on line 3
Output for Object typehint
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7:3 Stack trace: #0 /in/4dGn7(2): f(5) #1 {main} thrown in /in/4dGn7 on line 3
Output for Array change keys
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7:3 Stack trace: #0 /in/4dGn7(2): f(5) #1 {main} thrown in /in/4dGn7 on line 3
Output for Lexical anon
Catchable fatal error: Argument 1 passed to f() must be an instance of double, float given, called in /in/4dGn7 on line 2 and defined in /in/4dGn7 on line 3

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