For anyone coming across this now: this is the old behaviour; starting with PHP 8 this will not output anything. (More accurately, the
== test on the last line will now evaluate to
0 is no longer equal to
"Dog+Breath" and that false value would be cast to an empty string for output.)
Previously, as noted by pbismad, "integer==string" comparisons were handled by first casting the string to an integer. But as illustrated here, that led to weird and surprising results. Now, effectively, the comparison is made by first converting the integer to a string.