Bug #77287 [Asn]: Fatal error: Uncaught TypeError
| From: | nikic@php.net | Date: | Wed, 02 Jan 2019 13:15:48 +0000 |
| Subject: | Bug #77287 [Asn]: Fatal error: Uncaught TypeError | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218749@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77287&edit=1
ID: 77287
Updated by: nikic@php.net
Reported by: someone dot is dot alive at gmail dot com
Summary: Fatal error: Uncaught TypeError
Status: Assigned
Type: Bug
Package: opcache
Operating System: Windows
PHP Version: 7.3.0
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
If you are using a 32-bit build, then I've committed a possible fix in https://github.com/php/php-src/commit/325a1139744413420a62d3006c04914587628810.
If not, then the issue must be somewhere else...
Previous Comments:
------------------------------------------------------------------------
[2019-01-02 12:20:20] nikic@php.net
Could it be that you're on a 32-bit system (or use a 32-bit PHP build)?
------------------------------------------------------------------------
[2018-12-28 11:35:55] pirogen at protonmail dot com
It looks like the bug only occurs with *both* opcache and xdebug enabled. Disabling *either* makes
the issue go away.
------------------------------------------------------------------------
[2018-12-26 00:49:14] pirogen at protonmail dot com
I've encountered this as well after upgrading from 7.2 to 7.3 on Debian Testing. Unfortunately,
I can't seem to reproduce it in a minimal fashion; it only occurs in a project with rather
large graph of inter-dependent objects.
The bug manifests itself with class methods that use constants (can be a class constant, built-in
constant or user-defined global constant) as default parameter values, i.e.:
public function someMethod($some_param=SOME_CONSTANT) {}
When someMethod is called with no arguments, $some_param *sometimes* (more often than not, but not
always) receives a value that var_dump() identifies as NFC. Which, if passed down to a function or
method that expects a specific type, throws a "[function] expects parameter [num] to be [type],
unknown given" error OP mentions.
------------------------------------------------------------------------
[2018-12-17 00:40:12] andrew at fw dot net dot nz
I encountered the same error after upgrading php-fpm from 7.2 to 7.3 on Ubuntu 18.04. An argument
with a default parameter threw a type error "unknown given" when the callee did not
provide the argument at all.
I ran opcache_reset() which resolved it.
A google search found another mention of the same error in 7.3 here:
https://github.com/nextcloud/server/issues/11868
------------------------------------------------------------------------
[2018-12-12 10:59:04] nikic@php.net
Can't repro on Ubuntu, possibly Windows only.
The resolved default value for the 2nd arg will be stored in the RT cache, so maybe there is an
invalidation problem.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=77287
--
Edit this bug report at https://bugs.php.net/bug.php?id=77287&edit=1