php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1473 String assignement in class
Submitted: 1999-05-30 12:06 UTC Modified: 1999-05-30 12:10 UTC
From: andraax at cybercable dot fr Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.7 OS: Linux 2.2.5-15 Redhat
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andraax at cybercable dot fr
New email:
PHP Version: OS:

 

 [1999-05-30 12:06 UTC] andraax at cybercable dot fr
let's see this code:

class dummy{
    var $yes ;
    var $no ;

    function dummy($y, $n ) {
        $this->$yes = $y ;
        $this->$no = $n ;
        print "Y=$y|YES=".$this->$yes."|N=$n|NO=".$this->$no."<BR>" ;
    }
}

$test = new dummy("ab", "cd") ;
//OUPUT =Y=ab|YES=cd|N=cd|NO=cd !!!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-30 12:10 UTC] andrey at cvs dot php dot net
You have to refer to class variables without $, e.g. $this->yes not $this->$yes.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 08:00:01 2026 UTC