Consider the following program:
<?php
$str1='Hello';
$str2='hELLo';
echo strcmp($str1,$str2);
?>
As per my knowledge:
At the point where first mismatch is found the ASCII value difference of the two characters are given.
If the first mismatch is found between a valid character and an empty character the extra number of characters of longer string is given as output.
Hence, the output of above character should be
ASCII value of H
- ASCII value of h
= 72 - 104
= - 32
My browser gives the same output as well.
However in w3school
the answer is given as -1
Also in phpdotnet
in user contributed notes section, user luizvid at gmail dot come puts forward similar concept as given in w3schools.
Please clear my confusion.