Bug #77467 [NEW]: Constant as default class constructor parameter is unknown
| From: | abc905 at mail dot ru | Date: | Wed, 16 Jan 2019 12:20:31 +0000 |
| Subject: | Bug #77467 [NEW]: Constant as default class constructor parameter is unknown | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-218987@lists.php.net to get a copy of this message | ||
From: abc905 at mail dot ru
Operating system: Linux Debian 4.9.0-4-amd64
PHP version: 7.3.1
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Constant as default class constructor parameter is unknown
Description:
------------
After 5th http request to NginX server next error occur:
(After 3rd http request to built-in php server)
Jan 16 14:44:17 debian php-fpm7.3[9823]: ool www[9823]: PHP Fatal error:
Uncaught TypeError: Argument 1 passed to x\A::__construct() must be of
the type int, unknown given, called in index.php on line 6 and defined
in index.php:11
Jan 16 14:44:17 debian php-fpm7.3[9823]: ool www[9823]: Stack trace:
Jan 16 14:44:17 debian php-fpm7.3[9823]: ool www[9823]: #0
/home/user/Projects/gogomoms.vm/backend/api/v1/routes/tag/index.php(6):
x\A->__construct()
Jan 16 14:44:17 debian php-fpm7.3[9823]: ool www[9823]: #1 [internal
function]: x\{closure}(Object(Exception))
Jan 16 14:44:17 debian php-fpm7.3[9823]: ool www[9823]: #2 {main}
Jan 16 14:44:17 debian php-fpm7.3[9823]: ool www[9823]: thrown in
/home/user/Projects/gogomoms.vm/backend/api/v1/routes/tag/index.php on
line 11
Test script:
---------------
$ sudo php -S localhost:88 -t .
$ curl http://localhost:88
$ curl http://localhost:88
$ curl http://localhost:88
index.php :
-----------
<?php
namespace x;
set_exception_handler(function () {
$A = new A();
$A->do();
});
class A
{
public function __construct(int $n = LOG_LOCAL0)
{
}
public function do()
{
$this->done();
}
private function done()
{
}
}
throw new \Exception();
--
Edit bug report at https://bugs.php.net/bug.php?id=77467&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77467&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77467&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77467&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77467&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77467&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77467&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77467&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77467&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77467&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77467&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77467&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77467&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77467&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77467&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77467&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77467&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77467&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77467&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77467&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77467&r=mysqlcfg