PHP 4.0 Bug #7833 Updated: Array and class works strange

From: Date: Tue, 21 Nov 2000 14:37:44 +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-38825@lists.php.net to get a copy of this message
ID: 7833 Updated by: stas Reported By: jens@unfaehig.de Status: Feedback Bug Type: Scripting Engine problem Assigned To: Comments: After correcting numerous syntax errors in your code and after assuming $i is 1, works like charm for me. What is value of $i? Please, just make a full script, ensure that it is syntactically correct but doesn't run and post it. Previous Comments: --------------------------------------------------------------------------- [2000-11-21 09:30:32] jens@unfaehig.de <? 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. --------------------------------------------------------------------------- [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

« previous php.dev (#38825) next »