Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Laruence
On Sat, Aug 4, 2012 at 12:47 AM, Stas Malyshev wrote: > Hi! > >> I'm looking at a segfault in the SPL caused by the blind creation of a >> class, which seems to only fail when the class is disabled. I'm >> wondering in how many other places this could occur. > > This seems to be pretty bad. I'd sa

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Stas Malyshev
Hi! > I'm looking at a segfault in the SPL caused by the blind creation of a > class, which seems to only fail when the class is disabled. I'm > wondering in how many other places this could occur. This seems to be pretty bad. I'd say creation of an instance of disabled class should be a fatal er

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Stan Vass
Which brings up the issues that I mentioned before. Getting the return of an erroring function isn't such a big issue, but turning everything into exceptions would prevent getting any return value from any function/operation which triggers anything, Maybe you want to keep your cake and eat

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Stan Vass
a php function/operation can raise more than one warning, how would you handle that? with exceptions you would only get the first one. another issue is that with the current error handling model a call can trigger a non-fatal error and still return some data. with exeptions you can't do

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Andrew Faulds
On 03/08/12 17:04, Ferenc Kovacs wrote: Warnings are special, they aren't really errors as such. They wouldn't become exceptions. Also, why should an erroring function return a value? from "My experience shows it's best to have an error handler convert all errors to catchable ex

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Ferenc Kovacs
> > >> Warnings are special, they aren't really errors as such. They wouldn't > become exceptions. > > Also, why should an erroring function return a value? > > from "My experience shows it's best to have an error handler convert all errors to catchable exceptions, with some error types (like E_ST

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Andrew Faulds
On 03/08/12 16:50, Ferenc Kovacs wrote: On Fri, Aug 3, 2012 at 4:19 PM, Stan Vass wrote: Hi all, Can anyone explain to me the reason that when a function or class is disabled via the ini setting, an attempt to access the disabled item generates a non-fatal error? I'm looking at a segfault in

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Ferenc Kovacs
On Fri, Aug 3, 2012 at 4:19 PM, Stan Vass wrote: > Hi all, >> >> Can anyone explain to me the reason that when a function or class is >> disabled via the ini setting, an attempt to access the disabled item >> generates a non-fatal error? >> >> I'm looking at a segfault in the SPL caused by the bl

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Laruence
On Fri, Aug 3, 2012 at 3:08 PM, Leigh wrote: > Hi all, > > Can anyone explain to me the reason that when a function or class is > disabled via the ini setting, an attempt to access the disabled item > generates a non-fatal error? > > I'm looking at a segfault in the SPL caused by the blind creatio

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Stan Vass
Hi all, Can anyone explain to me the reason that when a function or class is disabled via the ini setting, an attempt to access the disabled item generates a non-fatal error? I'm looking at a segfault in the SPL caused by the blind creation of a class, which seems to only fail when the class is

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Etienne Kneuss
On Fri, Aug 3, 2012 at 1:59 PM, Leigh wrote: >> 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. Another great use-case for engine-thrown exceptions. IMHO we should really rethink the

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Leigh
> 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

Re: [PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Hannes Magnusson
On Fri, Aug 3, 2012 at 8:08 AM, Leigh wrote: > Hi all, > > Can anyone explain to me the reason that when a function or class is > disabled via the ini setting, an attempt to access the disabled item > generates a non-fatal error? Because there isn't anything actually wrong. A fatal error is rese

[PHP-DEV] Why do disabled functions / classes generate a WARNING.

2012-08-03 Thread Leigh
Hi all, Can anyone explain to me the reason that when a function or class is disabled via the ini setting, an attempt to access the disabled item generates a non-fatal error? I'm looking at a segfault in the SPL caused by the blind creation of a class, which seems to only fail when the class is d