Re: Using a Resource as a Class Property



Michael Fesser wrote:
.oO(Sanders Kaufman)

So, bottom line, what you're saying here is that when you extend a base class like this, you still have to manually call the base class's constructor? Zat right?

Correct. PHP doesn't do that automatically, except if the child class
doesn't have a constructor. Then PHP will call the one from the base
class, if it exists. But as soon as your child class uses its own
constructor, you have to manually call the parent one. Usually this
should be the first action.

Got it - and I wish I'd got it a year ago!

Is that a normal OOP way to do it - done that way in C++ and whatnot - or is this unique to PHP?

.



Relevant Pages

  • Re: Constructor as a "Reset" Button
    ... constructor is more or less just for initialization, ... In PHP you might get ... And HIPPA certification is not easy - nor is it cheap. ...
    (comp.lang.php)
  • Problems using exif_thumbnail() to create thumbnail image
    ... PHP 4.3.2 with --enable-exif ... class ThumbGenerator extends MethodGeneratorForActionPerformer { ... function ThumbGenerator{// CONSTRUCTOR ... system for the function to extract the embedded thumbnail information ...
    (alt.php)
  • Problems using exif_thumbnail() to create thumbnail image
    ... PHP 4.3.2 with --enable-exif ... class ThumbGenerator extends MethodGeneratorForActionPerformer { ... function ThumbGenerator{// CONSTRUCTOR ... system for the function to extract the embedded thumbnail information ...
    (comp.lang.php)
  • How do you build a singleton class in PHP? Can you?
    ... [PHP] ... class ActionHandler { ... constructor by reference only. ... Everything in the FileGenerator class object method works just fine ...
    (comp.lang.php)
  • Re: Constructor as a "Reset" Button
    ... constructor is more or less just for initialization, ... You're somewhat correct when you say that it's "more or less just for initialization". ... In PHP you might get ... I am, however, simultaneously developing a reference model for this foundation/framework and it IS a global application object. ...
    (comp.lang.php)