Bug #77467 [Opn->Fbk]: Constant as default class constructor parameter is unknown

From: Date: Wed, 16 Jan 2019 15:35:11 +0000
Subject: Bug #77467 [Opn->Fbk]: Constant as default class constructor parameter is unknown
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219002@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77467&edit=1 ID: 77467 Updated by: nikic@php.net Reported by: abc905 at mail dot ru Summary: Constant as default class constructor parameter is unknown -Status: Open +Status: Feedback Type: Bug Package: Scripting Engine problem Operating System: Linux Debian 4.9.0-4-amd64 PHP Version: 7.3.1 Block user comment: N Private report: N New Comment: This looks like bug #77287. Are you using xdebug? Previous Comments: ------------------------------------------------------------------------ [2019-01-16 12:20:31] abc905 at mail dot ru 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 this bug report at https://bugs.php.net/bug.php?id=77467&edit=1

« previous php.bugs (#219002) next »