|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2001-02-07 16:21 UTC] di99otmi at hd dot chalmers dot se
 function Bjbase($antal){  
    $this->$lekar=$antal;
    $this->$dragna=array();
    $this->$ess=58;
    echo $this->$dragna;
  }
this is a constructor
the echo statement prints 58 even though that it is $ess that is initialized to 58.
The variable $dragna is not treated as an array anywhere but when the $ess line is gone it works fine.
tried at another server too.
is this a problem you know of?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
Your code is incorrect, try this: function Bjbase($antal){ $this->lekar=$antal; $this->dragna=array(); $this->ess=58; echo $this->dragna; }