After switching from PHP 5.3 on Windows Server 2003 to PHP 7.4.3 on Linux Mint 19.3 (Tricia Cinnamon), I find that the output of print_r() has changed.
If we look at the documentation (https://www.php.net/manual/en/function.print-r.php), the provided example output is as it was on my earlier machine:
<pre>
Array
(
[a] => apple
[b] => banana
[c] => Array
(
[0] => x
[1] => y
[2] => z
)
)
</pre>
However, on the second machine, the output is:
<pre>
Array
(
[a] => apple
[b] => banana
[c] => Array
(
[0] => x
[1] => y
[2] => z
)
<blank line>
)
</pre>
Note the unexpected new line after each recursed array's closing parenthesis. The new line is not present after the outermost array closing parenthesis.
Also to note, there is a newer version of XDebug installed.
My question is: Is this a bug? (Follow-on question: if possible to determine at which version the output changed, what version would that be?)
This difference is causing existing code to not be able to correctly parse that output.