preg_replace (broken):
string(40) "test\nreturns\nare\nreplaced as expected"
preg_replace (fixed):
string(37) "test
returns
are
replaced as expected"
str_replace:
string(39) "test
returns
are
replaced as expected"
str_replace (double quotes):
string(37) "test
returns
are
replaced as expected"
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.