Date: 10/07/99
- Next message: Thies C. Arntzen: "Re: [PHP-DEV] Bug #2456: invalid character"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2460 Updated: Broken array_push? Or seriously misbehaving multidimensional arrays???"
- In reply to: Danny Heijl: "[PHP-DEV] Re: PHP 4.0 Bug #2430 Updated: memory leaks in zend"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I reversed my patch and will look into it a bit more.
You can CVS update again to reverse the patch.
Andi
At 11:22 PM 10/6/99 +0200, Danny Heijl wrote:
>Sorry, but the tests on classes now fail instead :
>
>The simple class test (classes/class-example.php3) :
>
><?php
>
>/* pretty nifty object oriented code! */
>
>class user {
> var $first_name,$family_name,$address,$phone_num;
> cfunction display()
> {
> echo "User information\n";
> echo "----------------\n\n";
> echo "First name:\t ".$this->first_name."\n";
> echo "Family name:\t ".$this->family_name."\n";
> echo "Address:\t ".$this->address."\n";
> echo "Phone:\t\t ".$this->phone_num."\n";
> echo "\n\n";
> }
> cfunction initialize($first_name,$family_name,$address,$phone_num)
> {
> $this->first_name = $first_name;
> $this->family_name = $family_name;
> $this->address = $address;
> $this->phone_num = $phone_num;
> }
>};
>
>
>function test($u)
>{ /* one can pass classes as arguments */
> $u->display();
> $t = $u;
> $t->address = "New address...";
> return $t; /* and also return them as return values */
>}
>
>$user1 = new user;
>$user2 = new user;
>
>$user1->initialize("Zeev","Suraski","Ben Gourion 3, Kiryat Bialik,
>Israel","+972-4-8713139");
>$user2->initialize("Andi","Gutmans","Haifa, Israel","+972-4-8231621");
>$user1->display();
>$user2->display();
>
>$tmp = test($user2);
>$tmp->display();
>
>?>
>
>now gives the following result :
>
>**********************************************************
>Content-Type: text/html
>
><br>
><b>Fatal error</b>: Call to a member function on a non-object
> in <b>cl1.php3</b> on line <b>40</b><br>
>
>***********************************************************
>
>And the class inheritance test (classes/inheritance.php3) :
><?php
>
>/* Inheritance test. Pretty nifty if I do say so myself! */
>
>class foo {
> var $a;
> var $b;
> cfunction display() {
> echo "This is class foo\n";
> echo "a = ".$this->a."\n";
> echo "b = ".$this->b."\n";
> }
> cfunction mul() {
> return $this->a*$this->b;
> }
>};
>
>class bar extends foo {
> var $c;
> cfunction display() { /* alternative display function for class bar */
> echo "This is class bar\n";
> echo "a = ".$this->a."\n";
> echo "b = ".$this->b."\n";
> echo "c = ".$this->c."\n";
> }
>};
>
>
>$foo1 = new foo;
>$foo1->a = 2;
>$foo1->b = 5;
>$foo1->display();
>echo $foo1->mul()."\n";
>
>echo "-----\n";
>
>$bar1 = new bar;
>$bar1->a = 4;
>$bar1->b = 3;
>$bar1->c = 12;
>$bar1->display();
>echo $bar1->mul()."\n";
>?>
>
>gives the following result :
>
>***********************************************************
>Content-Type: text/html
>
>This is class foo
>a = 2
>b = 5
><br>
><b>Fatal error</b>: Call to a member function on a non-object
> in <b>cl2.php3</b> on line <b>33</b><br>
>
>***********************************************************
>
>Danny
>---
>
>Bug Datbase wrote:
> >
> > ID: 2430
> > Updated by: andi
> > Reported By: Danny.Heijl <email protected>
> > Status: Closed
> > Bug Type: Scripting Engine problem
> > Assigned To:
> > Comments:
> >
> > I have fixed this leak. Please update your CVS tree and see if it's OK.
> > Thanks for the report.
> >
> > Full Bug description available at: http://bugs.php.net/version4/?id=2430
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Thies C. Arntzen: "Re: [PHP-DEV] Bug #2456: invalid character"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2460 Updated: Broken array_push? Or seriously misbehaving multidimensional arrays???"
- In reply to: Danny Heijl: "[PHP-DEV] Re: PHP 4.0 Bug #2430 Updated: memory leaks in zend"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

