On Mon, Dec 29, 2014 at 2:42 PM, Levi Morrison <le...@php.net> wrote:
> On Mon, Dec 29, 2014 at 6:17 AM, Levi Morrison <le...@php.net> wrote: > > On Mon, Dec 29, 2014 at 3:22 AM, Stanislav Malyshev <smalys...@gmail.com> > wrote: > >> Hi! > >> > >>> Hi Stas > >>> > >>> 2014-12-29 9:05 GMT+01:00 Stas Malyshev <smalys...@gmail.com>: > >>>> The CI tests still seem to be failing: > >>>> > >>>> ===================================================================== > >>>> FAILED TEST SUMMARY > >>>> --------------------------------------------------------------------- > >>>> SPL: spl_autoload() and friends [ext/spl/tests/spl_autoload_001.phpt] > >>>> SPL: spl_autoload() with methods [ext/spl/tests/spl_autoload_005.phpt] > >>>> SPL: spl_autoload() with inaccessible methods > >>>> [ext/spl/tests/spl_autoload_007.phpt] > >>>> SPL: spl_autoload() with exceptions > [ext/spl/tests/spl_autoload_008.phpt] > >>>> ===================================================================== > >>>> > >>>> Please take a look. > >>> > >>> I looked at the tests and: > >>> > >>> * spl_autoload_001.phpt fails with an E_RECOVERABLE_ERROR but that is > >>> not due to my patch (tests with and without) > >>> * spl_autoload_005.phpt fails due to an E_STRICT (non-static method > >>> called statically) > >>> * spl_autoload_007.phpt fails due to same reason as > >>> spl_autpload_001.phpt it seems > >>> * spl_autoload_008.phpt fails due to an E_STRICT like > spl_autoload_005.phpt > >> > >> You are right, looks like this is caused by > >> > https://github.com/php/php-src/commit/ad728725cb8e899a8415aa81db48825fac25e0d5 > >> > >> Levi, could you please take a look and fix it? > > > > Indeed, looking. Perhaps I simply ran Zend/ tests instead of all by > > accident; I apologize. > > The issue is obvious: I fixed the discrepancy between the docs and the > ARG_INFO listed by requiring the first parameter to > spl_autoload_register to be a callable. However, spl_autoload_register > has a second parameter that says whether or not an exception should be > thrown if it can't register the callback. Honestly, this is silly. Why > are we emulating `callable` types still when we have callable types? > > As far as I can tell, this second parameter is only useful when the > first is not callable; as such it would be unused if we actually > enforced the callable type like we normally would do. I want to keep > the type in arg_info because > > 1) providing a non-callable type is a logical error even if you > suppress it with $throw = false > 2) and parameter types are the standard way of checking this, not some > odd boolean as another parameter > > but > > 3) this would make the second parameter unused > 4) and if we removed it that would be a signature break. > > Sadly, I think the best option is to revert the change. Anyone else > have a comment on this? > I think it would be wise to revert the change for now, and either think about a solution which wouldn't require a BC break, or create an rfc for it. -- Ferenc Kovács @Tyr43l - http://tyrael.hu