|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9092 variables-by-references in class constructor not working
Submitted: 2001-02-03 17:53 UTC Modified: 2001-06-12 12:41 UTC
From: t dot stinner at billiton dot de Assigned:
Status: Closed Package: Class/Object related
PHP Version: 4.0.4pl1 OS: Linux 2.2.16
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: t dot stinner at billiton dot de
New email:
PHP Version: OS:


 [2001-02-03 17:53 UTC] t dot stinner at billiton dot de
This code snippet:

class test {
      function test(&$test1=false) {

gives me 

Parse error - parse error, expecting `')''

on the line with the constructor (function ...)

shouldn't this work (or at least return a useful error)?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-03 18:09 UTC]
This should not work - how can you pass a literal value by reference?

However, you are right about the error message - it does seem to be incorrect.
 [2001-02-03 19:00 UTC] t dot stinner at billiton dot de
hmm, i see your point.

is it possible to define a value that should be 
passwd by reference as optional?

 [2001-02-20 01:34 UTC]
covered by 6343 
 [2001-06-12 12:41 UTC]
You cant pass a literal via reference. Closing report. This is in the todo for 4.1.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 09:01:28 2024 UTC