ID: 28194 Updated by: [EMAIL PROTECTED] Reported By: email at philbert dot nl -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux PHP Version: 4.3.4 New Comment:
Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2004-05-01 13:13:30] email at philbert dot nl When hardcoding an array, this problem does not seem to appear, so it seems related to the use of database functionality. Is there a way to create a lifelike result resource without actually using a database? ------------------------------------------------------------------------ [2004-04-28 09:07:01] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2004-04-27 22:34:49] email at philbert dot nl Description: ------------ class RSSitem { var $dblink; var $success = false; var $items; var $currentItem; function RSSitem($pDBname, $pUsername, $pPassword) { $this->$dblink = mysql_connect("localhost:3306",$pUsername, $pPassword); if (mysql_select_db($pDBname, $this->$dblink)) { $query = "select id " . " , title " . " , description " . " , guid " . " , link " . " , pubDate " . "from item " . "order by id desc"; $this->$items = mysql_query($query, $this->$dblink); if ($this->$items) { $this->$currentItem = mysql_fetch_assoc($this->$items); if ($this->$currentItem) { $this->success = true; //print_r($this->$currentItem); } } } } function title() { $value = $this->$currentItem["title"]; return $value; } } When an object of class RSSitem is made, and the function object.title() is called, it returns the entire array $this->$currentItem, instead of entry ["title"] of this array. When I rewrite the function thus: function title() { $temparray = $this->$currentItem; $value = $temparray["title"]; return $value; } it does work. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28194&edit=1