|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #520 reference variables in class functions
Submitted: 1998-07-08 11:33 UTC Modified: 1998-07-10 09:07 UTC
From: be at shonline dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Final Release OS: solaris 2.5.1
Private report: No CVE-ID: None
 [1998-07-08 11:33 UTC] be at shonline dot de
defining a function with reference variables

like this:

function funcname(&$parm) {

doesnt work inside classes. The following script documents this
(sorry i could not get it shorter)

class a {
  function one(&$s) {
  # see -------^
  function two() {
    # see -----^
    print $s."\n";
    # see -----^
    print $s."\n";
$o = new a;

It should produce:


But it produces


I suspect this behaviour to cause a core dump under certain circumstances.

I assume this is a bug?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-10 09:07 UTC] zeev
Definitely is a bug.  *THANKS* for reporting it with such a reproduceable script.  I've been able to easily reproduce the problem
and track it down.  It's fixed in the latest CVS, and will be a part of PHP 3.0.2.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jan 21 17:01:24 2020 UTC