SoapClient::__doRequest undocumented backwards incompatible in PHP 8.5
Description
I found an undocumented backwards incompatible change that is breaking existing SoapClient implementations?!
Here, this break is not listed https://github.com/php/php-src/blob/php-8.5.0RC3/UPGRADING
Here, this change is documented but not as breaking https://github.com/php/php-src/blob/ad19b3e570e0760ec55f4357ae69f989345e4d61/NEWS#L341
The signature of SoapClient::__doRequest has changed, so it triggers the following errors in userland code
Declaration of xxxt::__doRequest($request, $location, $action, $version, $oneWay = 0): ?string must be compatible with SoapClient::__doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false, ?string $uriParserClass = null): ?string
Which i guess is quite common because you almost always have to override this function in SoapClient.
Also with the now per default enabled opcache for all in PHP 8.5 and the default opcache settings, you may not notice this errors because opcache swallows this error per default after the file is cached. This really hunted me because i've tested previous 8.5 versions without this error, until recently i found out about the opcache bug hidding thing.
Do i miss something?
PHP Version
PHP 8.5RC3, since PHP 8.5beta1
Operating System
No response
@brainfoolong Thanks for the report, and sorry for the trouble! I've just fixed the missing UPGRADING note in https://github.com/php/php-src/pull/20278.
As for opcache: isn't a version change supposed to invalidate the cache? 🤔
As for opcache: isn't a version change supposed to invalidate the cache?
Thx for the update.
Yes, it does. It also invalidate when you change the file. But when you do upgrading from php 8.4 to 8.5 it's common to hit more errors than just this in a test suite of a few hundred tests.
And if you try to reproduce errors with a second run, they disappear "magically". Because of the opcache and default opcache.record_warnings=0 option in php.ini that you are probably unaware of when you never have used opcache before.
So, in our case, we didn't know this option just was unable to reproduce this error the second time we ran the tests. This also happened with a lot of other errors as well.
This workflow and knowledge problem was on our side and it's not related to this exact error, but yeah, the opcache default for people never enabled opcache before will be a pain for many people to debug, i guess.
Edit: We now enabled opcache.record_warnings=1 to always see all errors, no matter if they are cached or not (Default behaviour as with no opcache enabled)
Hey, I also encountered this. The issue is clear now, but it took a while for me to find this because it resulted in a fatal error without a message. With class:
<?php
declare(strict_types=1);
namespace App\Soap;
class Soap extends \SoapClient
{
/**
* {@inheritdoc}
*/
public function __doRequest(
string $request,
string $location,
string $action,
int $version,
bool $oneWay = false,
): ?string {
return '';
}
}
I get:
Fatal error: Premature end of PHP process when running ...
Output with gdb:
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/php...
(No debugging symbols found in /usr/local/bin/php)
(gdb) run
Starting program: /usr/local/bin/php vendor/bin/phpunit
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
PHPUnit 12.5.6 by Sebastian Bergmann and contributors.
Runtime: PHP 8.5.2
Configuration: ...
Random Seed: 1768903260
....Fatal error: Premature end of PHP process when running ....
PHP version:
PHP 8.5.2 (cli) (built: Jan 16 2026 23:20:01) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.2, Copyright (c) Zend Technologies
with Xdebug v3.5.0, Copyright (c) 2002-2025, by Derick Rethans
with Zend OPcache v8.5.2, Copyright (c), by Zend Technologies
System details:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Linux 8d3fa19981f8 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 13:53:54 UTC 2025 aarch64 GNU/Linux