PHP 4.0 Bug #7833 Updated: Array and class works strange
| From: | jens at unfaehig dot de | Date: | Tue, 21 Nov 2000 14:30:32 +0000 |
| Subject: | PHP 4.0 Bug #7833 Updated: Array and class works strange | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38824@lists.php.net to get a copy of this message | ||
ID: 7833
User Update by: jens@unfaehig.de
Old-Status: Feedback
Status: Open
Bug Type: Scripting Engine problem
Description: Array and class works strange
<?
class cd_r{
var $id;
var $description;
var $text;
var $size;
var $count;
function list_txt(){
}
function html_desc(){ }
$temp= new cd_r;
$temp->id='potato_arm_nonus';
$temp->description='Debian GNU/Linux 2.2 rev0 (Potato) für arm, offizielle Binary-CDs, mit
non-US';
$temp->size=3;
$temp->html_desc="<b>".$temp->description."</b><br/>.$temp->text;
$sets[$i]=$temp;
and then later:
$sets[1]->list_txt();
I have shortened some things, esp. I have deleted the bodies of the member functions of the class.
The bug seems to be known, it is described as a comment in the online docs under www.php3.de (this
is the mirrored php.net, isn't it?) in the article about classes.
Previous Comments:
---------------------------------------------------------------------------
[2000-11-21 08:42:15] stas@php.net
Could you please give short script example that doesn't work
(including the class, etc.)?
---------------------------------------------------------------------------
[2000-11-15 12:40:29] jens@unfaehig.de
I have a class called "foo" with a function "bar".
I define
$test[1] = new foo;
When I try to use
$test[1]->bar();
I get an error "Call to a member function on a non-object ".
I would consider this being a bug.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7833