[PHP-DEV] Bug #1109: Argument passed by value behaves as if passed by reference! From: jason <email protected>
Date: 02/01/99

From: jason <email protected>
Operating system: freebsd 2.2.7
PHP version: 3.0.6
PHP Bug Type: Other
Bug description: Argument passed by value behaves as if passed by reference!

class series
{
  var $ID=0;
  var $objectArray=array(); //'ID'->position
 
  function initFromDB($ID)
  {
    if (!$ID) { die("<DIV CLASS='error'>ID is not set in series->initFromDB</DIV>"); }
    
    $this->ID=$ID;

    $query="SELECT objectID,position FROM objectSeriesXRef WHERE seriesID=$ID ORDER BY position";
    if (!$result=mysql_query($query)) { die("<DIV CLASS='error'>" . __FILE__ . ": Line " . __LINE__ . "<BR>$query<BR>" . mysql_error() . "</DIV>"); }
   
    while ( list($ID,$position)=mysql_fetch_row($result) )
    {
      $this->objectArray[$ID]=$position;
    }
  }
};

$series=new series;
echo "<BR>sID2: $seriesID";
$series->initFromDB($seriesID);
echo "<BR>sID3: $seriesID";

/* if $ID in series->initFromDB is NOT modified, no problem occurs */

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>