PHP equivalent
class Foo extends Bar { public function __construct($param) { parent::__construct($param); } }
This is explicitly mentioned in the PHP documentation for constructors .
You must keep in mind the important difference between C # and PHP: in PHP, unless you explicitly call the base constructor, it will not be called at all! This is not the same as in C #, where the base constructor is always invoked (although you can omit the explicit call if there is an open constructor without parameters).
source share