|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-11-15 12:40 UTC] jens at unfaehig dot 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jul 15 16:00:01 2026 UTC |
<? 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.