run-tests.php should generate code that has code line numbers equal to the original ones
Description
For example this test:
https://github.com/php/php-src/blob/PHP-8.0/ext/sockets/tests/socket_send.phpt#L26
fails on MacOS with the following result:
========DIFF========
002+
003+ Warning: socket_send(): Unable to write to socket [22]: Invalid argument in /Users/runner/work/php-src/php-src/ext/sockets/tests/socket_send.php on line 14
okey
okey
004- okey
========DONE========
FAIL int socket_send ( resource $socket , string $buf , int $len , int $flags ); [ext/sockets/tests/socket_send.phpt]
I expect the run-tests.php script to prepend:
<?php
?>
(and possible remove the ?><?php if the code to be run starts with <?php)
so the original line numbers equal to the original ones, eg. the testing output is:
002+
003+ Warning: socket_send(): Unable to write to socket [22]: Invalid argument in /Users/runner/work/php-src/php-src/ext/sockets/tests/socket_send.php on line 26
okey
okey
004- okey
========DONE========
FAIL int socket_send ( resource $socket , string $buf , int $len , int $flags ); [ext/sockets/tests/socket_send.phpt]
While some diffs are hard to interpret (and this would make alleviate this), it seems to me the root cause of this issue are to many expections (i.e. a too large --EXPECT-- section). It might be better to rewrite respective tests in the long run.
This would also break declares.
https://3v4l.org/3A0Xm#v8.1.5
<?php
?><?php
declare(strict_types=1);
Fatal error: strict_types declaration must be the very first statement in the script
so
(and possible remove the ?><?php if the code to be run starts with <?php)
is needed :)
Since the PR has been categorically rejected, I'm closing this ticket as WONTFIX accordingly.