Hi

On 9/11/23 01:57, Ben Ramsey wrote:
Since class names in PHP aren't case-sensitive, there should be no BC
concerns for changing existing classes to fit this new casing (for
Reflection, debug, and documentation purposes). That is, if we wanted to
also update all existing class names in PHP that contain acronyms (e.g.,
DOMDocument -> DomDocument, SimpleXMLElement -> SimpleXmlElement, etc.).


Userland string comparisons against the classname would break. In the simplest case the following:

    if (get_class($someObject) === 'DOMDocument') {
        // do something
    }

It most certainly isn't *great* code, but I don't find it completely unreasonable. Especially if the code dates back from before `::class` was added.

Best regards
Tim Düsterhus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to