Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection

2018-01-29 Thread Michael Morris
On Mon, Jan 29, 2018 at 6:16 PM, Larry Garfield wrote: > > > Really, these functions would be useful only on arrays, period. To allow > them > on anything else is just dangerous, and on other iterables there are > better, > more robust approaches (as discussed elsewhere in this thread). > > As yo

Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection

2018-01-29 Thread Larry Garfield
On Monday, January 29, 2018 3:35:18 PM CST Michael Morris wrote: > On Mon, Jan 29, 2018 at 3:26 PM, Rowan Collins > > wrote: > > Nor are generators the only non-rewindable iterables you need to worry > > about, so really the only options you have are to only inspect arrays, or > > to add a big fa

Re: [PHP-DEV] Potential adoption of run-tests.php replacement

2018-01-29 Thread Nazar Mokrynskyi
It was never intended to be a wrapper or to be 100% compatible. It was created as a simpler and modern replacement with additional features like colored output (tried to add this to run-tests.php initially, even submitted PR with some fixes and refactoring, but found it too complex to deal with)

Re: [PHP-DEV] Potential adoption of run-tests.php replacement

2018-01-29 Thread Matt Ficken
This is a reimplementation of run-test.php, not just a wrapper (so its another parser for the PHPT file format). However, its missing support for many PHPT sections (ie its PHPT format support is incomplete). See: https://github.com/nazar-pc/phpt-tests-runner/blob/master/bin/phpt-tests-runner#L117

Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection

2018-01-29 Thread Michael Morris
On Mon, Jan 29, 2018 at 3:26 PM, Rowan Collins wrote: > On 29 January 2018 19:14:43 GMT+00:00, Michael Morris > wrote: > > The is_callable() > >above prevents iteration over generators, potentially consuming them > >for no purpose. > > Unfortunately, it doesn't: it's not the generator definitio

Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection

2018-01-29 Thread Michael Morris
On Mon, Jan 29, 2018 at 3:26 PM, Rowan Collins wrote: > > Nor are generators the only non-rewindable iterables you need to worry > about, so really the only options you have are to only inspect arrays, or > to add a big fat warning that the function may consume your iterable (or > enter an infini

Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection

2018-01-29 Thread Rowan Collins
On 29 January 2018 19:14:43 GMT+00:00, Michael Morris wrote: > The is_callable() >above prevents iteration over generators, potentially consuming them >for no purpose. Unfortunately, it doesn't: it's not the generator definition that you'll be passed, but the Generator object returned when you

Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection

2018-01-29 Thread Michael Morris
> The more angles we approach this, the more it looks like generics, or at > least the same basis. Which is well outside the scope of what I'd like to see, so let's look at form 2 in closer detail - the all functions. bool all_array( mixed $var ) { if (is_iterable($var) && !is_callable) {

[PHP-DEV] Potential adoption of run-tests.php replacement

2018-01-29 Thread Nazar Mokrynskyi
Hi internals, As most of you know, there is this script called run-tests.php which is huge in size and hard to maintain. I also heard some wanted it to support parallel tests execution and probably other things. There is a project I've created a long time ago and still maintaining (https://gi