On 22 December 2014 at 01:43, Andrea Faulds wrote:

On 21 Dec 2014, at 23:33, David Muir wrote:

The insensitivity makes code brittle. Sometimes the same code will run
fine, and other times it breaks depending on what lines triggered the auto
loader. If you instantiate a Foo instance first, then instantiate a new
foo, the code runs fine, but if you try to instantiate a new foo first, we
get a fatal error.

I’d say that’s not the fault of insensitivity, but the fault of
poorly-written autoloaders.

I'd like to know if there's an autoloader that handles case sensitivity
without O(2^n) stat calls worst-case scenario (N being namespace/class name
parts chars).
A stricts standards warning in case of type sensitivity issues after a
class with the same was already loaded would make a lot of sense:

class Foo {}

$foo = new Foo;

$bar = ($foo instanceof foo); // stricts standards

Same goes for type-hints in methods, as those may break reflection (which
triggers autoloading).


Marco Pivetta



Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2019 Grokbase