In PHP, what are some key considerations when using the __construct function within classes to avoid errors and ensure proper functionality?

When using the __construct function within classes in PHP, it is important to ensure that all necessary parameters are passed correctly to avoid errors. Additionally, make sure to properly initialize any class properties or dependencies within the constructor to ensure proper functionality. Lastly, consider using type hinting and default parameter values to make the constructor more robust and easier to use.

class MyClass {
    private $property;

    public function __construct($param1, $param2 = null) {
        $this->property = $param1;
        $this->otherProperty = $param2;
    }
}

$instance = new MyClass('value1', 'value2');