> Because there isn't anything actually wrong.
>
> A fatal error is reserved for things we cannot recover from, but a
> disabled function is easily recoverable.

I don't see how it is any more recoverable than the function/class not
existing at all. How much code do you know of that checks for the
existence of every function it expects to be there, before using it?
The matter is even worse with classes, since creating a disabled class
does not return null. It returns an instantiated object with no
methods.

When an unexpected function is disabled, the engine can recover, sure.
The code, probably not. In my opinion it's better to stop the code
doing something potentially harmful than allowing it to continue with
bad data.

It seems inconsistent to me.

--

$a = new UndefinedClass; // PHP Fatal error:  Class 'UndefinedClass' not found

--

$a = new DisabledClass; // Warning
var_dump(get_class($a)); // string(13) "disabledclass"

--

$a = undefinedFunction(); // PHP Fatal error:  Call to undefined
function undefinedFunction()

--

$a = disabledFunction(); // Warning
var_dump($a); // null

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

Reply via email to