3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test( $limited_email_domains ) { $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); var_dump( gettype( $limited_email_domains ) ); } test( 0 ); test( false ); test( '' ); test( array( 'foo', 'bar', 'baz' ) ); // This one will throw a fatal error as str_replace's third param must be string or array. test( (object) array( 'foo', 'bar', 'baz' ) );
Output for git.master, git.master_jit, rfc.property-hooks
string(6) "string" string(6) "string" string(6) "string" string(5) "array" Fatal error: Uncaught TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, stdClass given in /in/Lfmgp:4 Stack trace: #0 /in/Lfmgp(4): str_replace(' ', '\n', Object(stdClass)) #1 /in/Lfmgp(15): test(Object(stdClass)) #2 {main} thrown in /in/Lfmgp on line 4
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:
61.17 ms | 401 KiB | 8 Q