Re: [PHP4BETA] OOP issue

From: Date: Tue, 16 Nov 1999 15:58:15 +0000
Subject: Re: [PHP4BETA] OOP issue
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-6295@lists.php.net to get a copy of this message
What if one wanted to call the super constructor and do further initialization? i.e. class Node { function Node() { $parent->init(); do localized initialization... } } Not a lot of call for this, but it would be nice :) Andi Gutmans wrote: > > Yep you're correct. > > Andi > > On Tue, 16 Nov 1999, Kristian [iso-8859-1] Köhntopp wrote: > > > > > Andi Gutmans wrote: > > > In PHP 4 if the child doesn't define a constructor it's supposed to > > > inherit the parents constructor. Only if you override the constructor do > > > you need to call the parent constructor explicitly. > > > > Did I understand this correctly: When I define a class Y extends X without > > providing Y::y() and X::x() is a constructor in X, a $y = new Y does > > call Y::x()? > > > > Ok, that works and it is probably the most confusing way to implement it. > > > > Kristian > > > > -- > > Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH > > Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00 > > Using PHP3? See our web development library at > > http://phplib.netuse.de/ (We have moved! Update your > > bookmarks!) > > > > -- > PHP 4.0 Beta Mailing List <http://www.php.net/version4/> > To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net > For additional commands, e-mail: php4beta-help@lists.php.net > To contact the list administrators, e-mail: php4beta-admin@lists.php.net -- Chad Cunningham ccunning@math.ohio-state.edu Physicists think the real world models equations. Engineers think equations model the real world. Mathematicians fail to make the connection.

« previous php.version4 (#6295) next »