|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #36265 Object as default function argument
Submitted: 2006-02-02 20:03 UTC Modified: 2016-12-30 23:33 UTC
Avg. Score:3.7 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: rael at grad dot icmc dot usp dot br Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.1.2 OS: Any
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.
Block user comment
Status: Assign to:
Bug Type:
From: rael at grad dot icmc dot usp dot br
New email:
PHP Version: OS:


 [2006-02-02 20:03 UTC] rael at grad dot icmc dot usp dot br
In some cases, it's a very usefull feature use an object as default function argument, what is not possible, generating an error in current versions of PHP.

Reproduce code:

	class Foo {}
	function bar(Foo $foo = new Foo()){}


Expected result:
A blank webpage.

Actual result:
Parse error: parse error, unexpected T_NEW in c:\Inetpub\wwwroot\phobos\testes\index.php on line 5


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:33 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Oct 31 20:01:24 2020 UTC