php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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)?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-03 18:09 UTC] zak@php.net
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] andre@php.net
covered by 6343 
 [2001-06-12 12:41 UTC] jmoore@php.net
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: Thu Dec 12 08:01:27 2024 UTC