3v4l.org

run code in 200+ PHP versions simultaneously
<?php function test(stdClass $data) { echo $data; } set_error_handler(function () { return false; }); test(123);

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 test() must be an instance of stdClass, int given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for branch php-master+opcache
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of stdClass, int given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for branch php-master+jit
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of stdClass, int given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for Typed properties v2
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of stdClass, int given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for Arrow functions
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of stdClass, integer given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for Object typehint
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of stdClass, integer given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for Array change keys
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of stdClass, integer given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F:3 Stack trace: #0 /in/Ymh8F(9): test(123) #1 {main} thrown in /in/Ymh8F on line 3
Process exited with code 255.
Output for Lexical anon
Catchable fatal error: Argument 1 passed to test() must be an instance of stdClass, integer given, called in /in/Ymh8F on line 9 and defined in /in/Ymh8F 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