[php-src] Issue #7873: Adding __toString method to class defined below instantiation causes class to not be detected

From: Date: Tue, 04 Jan 2022 10:34:50 +0000
Subject: [php-src] Issue #7873: Adding __toString method to class defined below instantiation causes class to not be detected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238752@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7873 Comment Author: cmb69 @pocallaghan, I'm not sure whether it makes sense to explain the complex early binding behavior in the PHP manual. Currently, there is a very much [simplified explanation](https://www.php.net/manual/en/language.oop5.inheritance.php): > Unless autoloading is used, the classes must be defined before they are used. If a class > extends another, then the parent class must be declared before the child class structure. This rule > applies to classes that inherit other classes and interfaces. The first sentence covers the example at hand. That said, feel free to [report a documentation bug](https://github.com/php/doc-en) or better a pull request for that repo.

« previous php.bugs (#238752) next »