What are the differences between PHP 4 and PHP 5 in terms of inheriting constructors in classes?

In PHP 4, constructors were not inherited by child classes, meaning that if a child class did not have its own constructor, it would not automatically inherit the parent class's constructor. However, in PHP 5, constructors are automatically inherited by child classes if the child class does not have its own constructor defined. To ensure that constructors are inherited properly in PHP 4, you would need to manually call the parent class's constructor within the child class's constructor.

// PHP 4 way of manually inheriting constructors
class ParentClass {
    function ParentClass() {
        echo "Parent constructor called";
    }
}

class ChildClass extends ParentClass {
    function ChildClass() {
        ParentClass::ParentClass();
    }
}
```

```php
// PHP 5 way of automatically inheriting constructors
class ParentClass {
    function __construct() {
        echo "Parent constructor called";
    }
}

class ChildClass extends ParentClass {
    // ChildClass does not have its own constructor
}

$child = new ChildClass(); // Output: Parent constructor called