3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump( strcmp("5", 5), // => 0 strcmp("15", 0xf), // => 0 strcmp(61529519452809720693702583126814, 61529519452809720000000000000000), // => 0 strcmp(NULL, false), // => 0 strcmp(NULL, ""), // => 0 strcmp(NULL, 0), // => -1 strcmp(false, -1), // => -2 strcmp("15", NULL), // => 2 strcmp(NULL, "foo"), // => -3 strcmp("foo", NULL), // => 3 strcmp("foo", false), // => 3 strcmp("foo", 0), // => 1 strcmp("foo", 5), // => 1 strcmp("foo", array()), // => NULL + PHP Warning strcmp("foo", new stdClass), // => NULL + PHP Warning strcmp(function(){}, "") // => NULL + PHP Warning );
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/X3SnD on line 6 Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/X3SnD on line 7 Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/X3SnD on line 8 Deprecated: strcmp(): Passing null to parameter #2 ($string2) of type string is deprecated in /in/X3SnD on line 10 Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/X3SnD on line 11 Deprecated: strcmp(): Passing null to parameter #2 ($string2) of type string is deprecated in /in/X3SnD on line 12 Fatal error: Uncaught TypeError: strcmp(): Argument #2 ($string2) must be of type string, array given in /in/X3SnD:16 Stack trace: #0 /in/X3SnD(16): strcmp('foo', Array) #1 {main} thrown in /in/X3SnD on line 16
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:
51.4 ms | 402 KiB | 8 Q