php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1109 Argument passed by value behaves as if passed by reference!
Submitted: 1999-02-01 17:18 UTC Modified: 1999-06-12 16:15 UTC
From: jason at wildrhino dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.6 OS: freebsd 2.2.7
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: jason at wildrhino dot com
New email:
PHP Version: OS:

 

 [1999-02-01 17:18 UTC] jason at wildrhino dot com
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 */

Patches

Pull Requests

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 10:01:33 2025 UTC