brianlange Posted August 29, 2010 Share Posted August 29, 2010 I am working with the Zend Framework and I noticed that some of the classes do not have constructor. For instance, Zend_ACL does not have a constructor. What happens with this class is instantiated? Is it just a sort of empty object? The class does not extend another class so a parent constructor is not being called. Quote Link to comment https://forums.phpfreaks.com/topic/211989-php-classes-without-constructors/ Share on other sites More sharing options...
Alex Posted August 29, 2010 Share Posted August 29, 2010 Having no defined constructor is the same as having an empty constructor. public function __construct() { } These objects obviously don't require anything to be done upon instantiation. Quote Link to comment https://forums.phpfreaks.com/topic/211989-php-classes-without-constructors/#findComment-1104803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.