3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pw1 = 'my cool password keep it secrete please'; $pw2 = 'some other password'; $abc = strcmp($xyz, $pw1); if ($abc == 0) { echo "LOLPHP: yes '$pw1' is the same as '$xyz'\n"; } $def = strcmp($xyz, $pw2); if ($def == 0) { echo "LOLPHP: yep '$pw2' is the same as '$xyz'\n"; } $ghi = strcmp($pw1, $pw2); if ($ghi != 0) { echo "'$pw1' isn't the same as '$pw2'\n"; } else {echo "i am strcmp, and i declare that '$pw1' is the same as '$pw2'!!\n"; } $jkl = strcmp($xyz, $xyz); echo "jkl = $jkl\n";
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined variable $xyz in /in/8VbH8 on line 6 Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/8VbH8 on line 6 Warning: Undefined variable $xyz in /in/8VbH8 on line 8 Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/8VbH8 on line 8 'my cool password keep it secrete please' isn't the same as 'some other password' Warning: Undefined variable $xyz in /in/8VbH8 on line 14 Warning: Undefined variable $xyz in /in/8VbH8 on line 14 Deprecated: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated in /in/8VbH8 on line 14 Deprecated: strcmp(): Passing null to parameter #2 ($string2) of type string is deprecated in /in/8VbH8 on line 14 jkl = 0
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $xyz in /in/8VbH8 on line 6 Warning: Undefined variable $xyz in /in/8VbH8 on line 8 'my cool password keep it secrete please' isn't the same as 'some other password' Warning: Undefined variable $xyz in /in/8VbH8 on line 14 Warning: Undefined variable $xyz in /in/8VbH8 on line 14 jkl = 0
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: xyz in /in/8VbH8 on line 6 Notice: Undefined variable: xyz in /in/8VbH8 on line 8 'my cool password keep it secrete please' isn't the same as 'some other password' Notice: Undefined variable: xyz in /in/8VbH8 on line 14 Notice: Undefined variable: xyz in /in/8VbH8 on line 14 jkl = 0
Output for 7.3.32 - 7.3.33
'my cool password keep it secrete please' isn't the same as 'some other password' jkl = 0
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.3
Notice: Undefined variable: xyz in /in/8VbH8 on line 6 Notice: Undefined variable: xyz in /in/8VbH8 on line 8 'my cool password keep it secrete please' isn't the same as 'some other password' Notice: Undefined variable: xyz in /in/8VbH8 on line 14 Notice: Undefined variable: xyz in /in/8VbH8 on line 14 jkl = 0

preferences:
297.14 ms | 402 KiB | 460 Q