php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77467 Constant as default class constructor parameter is unknown
Submitted: 2019-01-16 12:20 UTC Modified: 2019-01-16 15:56 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:0 of 1 (0.0%)
From: abc905 at mail dot ru Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.3.1 OS: Linux Debian 4.9.0-4-amd64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: abc905 at mail dot ru
New email:
PHP Version: OS:

 

 [2019-01-16 12:20 UTC] 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();



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-16 15:35 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2019-01-16 15:35 UTC] nikic@php.net
This looks like bug #77287. Are you using xdebug?
 [2019-01-16 15:54 UTC] abc905 at mail dot ru
Yes, you are right!
Commenting zend_extension=xdebug.so fixes the error. 
Thank you!
 [2019-01-16 15:56 UTC] nikic@php.net
-Status: Feedback +Status: Duplicate
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 07:01:25 2020 UTC