[PHP-DEV] @official_php credentials?

2020-02-04 Thread Nikita Popov
Hi, Does anyone know the credentials for the @official_php Twitter account? None of the releases since November last year (including 7.4.0) have been announced. Regards, Nikita

Re: [PHP-DEV] @official_php credentials?

2020-02-04 Thread Derick Rethans
Hi, Adam gave them to me last night, so: me. cheers, Derick On Tue, 4 Feb 2020, Nikita Popov wrote: > Hi, > > Does anyone know the credentials for the @official_php Twitter account? > None of the releases since November last year (including 7.4.0) have been > announced. > > Regards, > Nikita

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Marco Pivetta
Hey Midori, This has been discussed in more depth 2 years ago: https://externals.io/message/98539#98539 In practice, the `(array)` cast is one of the few operations that don't cause observable side-effects in this programming language: let's please keep it as such. Marco Pivetta http://twitter.

Re: [PHP-DEV] Moving the documentation to git

2020-02-04 Thread Derick Rethans
On Tue, 4 Feb 2020, Andreas Heigl wrote: > Sadly there was no response so far. Neither on the email as such nor on > the different tasks. Keep repeating them and poking the people. I have most definitely forgotten about what needs doing. cheers, Derick -- PHP 7.4 Release Manager Host of PHP I

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Midori Koçak
Marco, I've read it and your argument is strong. I think my opinion slightly moves towards Andreas, away from magic. here is something I wrote some days ago: https://github.com/midorikocak/arraytools/blob/master/src/ArrayConvertableTrait.php I guess you were saying something like this would be en

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Marco Pivetta
Hey Midori, On Tue, Feb 4, 2020 at 11:35 AM Midori Koçak wrote: > Marco, I've read it and your argument is strong. I think my opinion > slightly moves towards Andreas, away from magic. > > here is something I wrote some days ago: > https://github.com/midorikocak/ar

[PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Nikita Popov
On Tue, Feb 4, 2020 at 8:09 AM Andreas Heigl wrote: > Hey folks. > > During the last year I took a bit of time aside to bring the > documentation from SVN to git. And about a month ago I informed the > DOCs-Mailinglist about the current status and the fact that we are ready > to move to the next

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Rowan Tommins
On Tue, 4 Feb 2020 at 10:37, Marco Pivetta wrote: > Correct: an explicit `$foo->toArray()` call suffices. > > For other readers, more about `$foo->toArray()` vs `(array) $foo` is > described at > > https://github.com/ShittySoft/symfony-live-berlin-2018-doctrine-tutorial/pull/3#issuecomment-460441

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Rowan Tommins
On Tue, 4 Feb 2020 at 12:25, Tom Gerrits wrote: > "(string) $var" doesn't seem a lot less explicit to me than > "$var->toString()" > No, but it's significantly less explicit than "$var->getDebugString()" or "$var->formatHTML()" or "$var->getRawText()", all of which might exist on one class, and

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Steven Wade
> Oh there is even a rfc. https://wiki.php.net/rfc/to-array What is the > status of this? Hi there, I’m the author of that RFC. I intend to post it officially for discussion soon, I’ve just been busy and haven’t had the time that would be needed to respond to the discussion emails when they came

[PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Aimeos | Norbert Sendetzky
I would like to modify my initial concept of an "arrayable" type because PHP core developers seems to be in favor of the upcoming union data types instead of adding a new "arrayable" pseudo type similar to "iterable". So, I would like to propose an "Arrayable" interface that combines ArrayAccess,

[PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Andreas Heigl
Hey Nikita, hey all. Am 04.02.20 um 12:11 schrieb Nikita Popov: > On Tue, Feb 4, 2020 at 8:09 AM Andreas Heigl > wrote: > > Hi Andreas, > > would you mind pushing the current en/de repos to > https://github.com/phpdoctest/en and de so it's possible to see how they > l

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Tom Gerrits
Correct: an explicit `$foo->toArray()` call suffices. For other readers, more about `$foo->toArray()` vs `(array) $foo` is described at https://github.com/ShittySoft/symfony-live-berlin-2018-doctrine-tutorial/pull/3#issuecomment-460441229 This is a valid point. Perhaps another problem li

[PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Steven Wade
Hi all, I’d like to officially open my __toArray() RFC up to discussion. I’ve delayed changing the status until I had more time to respond to the discussion, but since it’s been brought up again , I figured now is the bes

[PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Nikita Popov
On Tue, Feb 4, 2020 at 1:48 PM Andreas Heigl wrote: > Hey Nikita, hey all. > > Am 04.02.20 um 12:11 schrieb Nikita Popov: > > On Tue, Feb 4, 2020 at 8:09 AM Andreas Heigl > > wrote: > > > > > Hi Andreas, > > > > would you mind pushing the current en/de repos to > > http

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Marco Pivetta
Linking (again) previous discussions: https://externals.io/message/98539#98539 `__toArray` as a magic function call when `(array)` cast happen is a bad idea: it is a BC break, and it removes one of the very few interactions (with objects) that didn't cause any side-effects ( https://externals.io/m

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Marco Pivetta
Hey Tom, On Tue, Feb 4, 2020 at 1:55 PM Tom Gerrits wrote: > "(string) $var" doesn't seem a lot less explicit to me than > "$var->toString()", but if it is coerced automatically when being > passed to e.g. a function taking a string, that is of course a > different story. > `(string) $var` is l

Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Steven Wade
> Oh there is even a rfc. https://wiki.php.net/rfc/to-array What is the > status of this? This RFC has now been moved to “under discussion” with the discussion happening here: https://externals.io/message/108369

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Steven Wade
> `__toArray` as a magic function call when `(array)` cast happen is a bad > idea: it is a BC break, Adding a new magic method is not a backwards compatibility break. The PHP documentation on magic methods states: "Caution PHP reserves all function names starting with __ as magical. It is re

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Benjamin Eberlei
On Tue, Feb 4, 2020 at 2:03 PM Steven Wade wrote: > Hi all, > > I’d like to officially open my __toArray() RFC < > https://wiki.php.net/rfc/to-array> up to discussion. I’ve delayed > changing the status until I had more time to respond to the discussion, but > since it’s been brought up again

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Benjamin Eberlei
On Tue, Feb 4, 2020 at 2:10 PM Marco Pivetta wrote: > Linking (again) previous discussions: > https://externals.io/message/98539#98539 > > `__toArray` as a magic function call when `(array)` cast happen is a bad > idea: it is a BC break, and it removes one of the very few interactions > (with obj

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Steven Wade
> I am open to the idea of having __toArray. I just have a few questions about > the RFC details. > > 1. print_r($object) would somehow call __toArray you say. Why would it cause > a cast when nothing else is cast? I would prefer print_r((array) $person); Originally I intended the proposal to

Re: [PHP-DEV] @official_php credentials?

2020-02-04 Thread Ben Ramsey
> On Feb 4, 2020, at 04:29, Derick Rethans wrote: > > Hi, > > Adam gave them to me last night, so: me. > > cheers, > Derick > > >> On Tue, 4 Feb 2020, Nikita Popov wrote: >> >> Hi, >> >> Does anyone know the credentials for the @official_php Twitter account? >> None of the releases since

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Marco Pivetta
On Tue, Feb 4, 2020, 14:36 Benjamin Eberlei wrote: > > > On Tue, Feb 4, 2020 at 2:10 PM Marco Pivetta wrote: > >> Linking (again) previous discussions: >> https://externals.io/message/98539#98539 >> >> `__toArray` as a magic function call when `(array)` cast happen is a bad >> idea: it is a BC b

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Benjamin Eberlei
On Tue, Feb 4, 2020 at 2:39 PM Steven Wade wrote: > > I am open to the idea of having __toArray. I just have a few questions > about the RFC details. > > 1. print_r($object) would somehow call __toArray you say. Why would it > cause a cast when nothing else is cast? I would prefer print_r((array)

Re: [PHP-DEV] @official_php credentials?

2020-02-04 Thread Derick Rethans
On Tue, 4 Feb 2020, Ben Ramsey wrote: > If you use TweetDeck, you can grant access to others, without needing > to pass around the credentials. Yes, that is exactly how we are using it. cheers, Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.ph

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Steven Wade
>> 3. The weak point of this proposal is the by reference handling for sort et >> al. Counterpoint: if you pass a variable to preg_match, then matches gets >> converted from anything to array, so i believe by reference casting should >> change the original value (https://3v4l.org/XUJ5m

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Aimeos | Norbert Sendetzky
Am 04.02.20 um 14:43 schrieb Marco Pivetta: >> I think we can't classify it as BC break, because no existing code >> implements __toArray at the moment, and hence it will not fail when this >> feature is introduced and code gets upgraded to newer versions. > > It is a BC break because it changes t

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Benjamin Eberlei
On Tue, Feb 4, 2020 at 2:43 PM Marco Pivetta wrote: > > > On Tue, Feb 4, 2020, 14:36 Benjamin Eberlei wrote: > >> >> >> On Tue, Feb 4, 2020 at 2:10 PM Marco Pivetta wrote: >> >>> Linking (again) previous discussions: >>> https://externals.io/message/98539#98539 >>> >>> `__toArray` as a magic fu

[PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Nikita Popov
On Tue, Feb 4, 2020 at 2:08 PM Nikita Popov wrote: > On Tue, Feb 4, 2020 at 1:48 PM Andreas Heigl wrote: > >> Hey Nikita, hey all. >> >> Am 04.02.20 um 12:11 schrieb Nikita Popov: >> > On Tue, Feb 4, 2020 at 8:09 AM Andreas Heigl > > > wrote: >> >> > >> > Hi Andreas, >>

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Marco Pivetta
On Tue, Feb 4, 2020, 14:50 Aimeos | Norbert Sendetzky wrote: > Am 04.02.20 um 14:43 schrieb Marco Pivetta: > >> I think we can't classify it as BC break, because no existing code > >> implements __toArray at the moment, and hence it will not fail when this > >> feature is introduced and code gets

Re: [PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Andreas Heigl
Hey Nikita. Am 04.02.20 um 15:20 schrieb Nikita Popov: > On Tue, Feb 4, 2020 at 2:08 PM Nikita Popov wrote: > >> On Tue, Feb 4, 2020 at 1:48 PM Andreas Heigl wrote: >> >>> Hey Nikita, hey all. >>> >>> Am 04.02.20 um 12:11 schrieb Nikita Popov: On Tue, Feb 4, 2020 at 8:09 AM Andreas Heigl >

Re: [PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Nikita Popov
On Tue, Feb 4, 2020 at 3:46 PM Andreas Heigl wrote: > Hey Nikita. > > Am 04.02.20 um 15:20 schrieb Nikita Popov: > > On Tue, Feb 4, 2020 at 2:08 PM Nikita Popov > wrote: > > > >> On Tue, Feb 4, 2020 at 1:48 PM Andreas Heigl wrote: > >> > >>> Hey Nikita, hey all. > >>> > >>> Am 04.02.20 um 12:11

Re: [PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Andreas Heigl
Hey Nikita. Am 04.02.20 um 15:49 schrieb Nikita Popov: > On Tue, Feb 4, 2020 at 3:46 PM Andreas Heigl wrote: > >> Hey Nikita. >> >> Am 04.02.20 um 15:20 schrieb Nikita Popov: >>> On Tue, Feb 4, 2020 at 2:08 PM Nikita Popov >> wrote: >>> On Tue, Feb 4, 2020 at 1:48 PM Andreas Heigl wrote:

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Chase Peeler
On Tue, Feb 4, 2020 at 9:23 AM Marco Pivetta wrote: > On Tue, Feb 4, 2020, 14:50 Aimeos | Norbert Sendetzky > wrote: > > > Am 04.02.20 um 14:43 schrieb Marco Pivetta: > > >> I think we can't classify it as BC break, because no existing code > > >> implements __toArray at the moment, and hence it

Re: [PHP-DEV] Re: Moving the documentation to git

2020-02-04 Thread Nikita Popov
On Tue, Feb 4, 2020 at 3:55 PM Andreas Heigl wrote: > Hey Nikita. > > Am 04.02.20 um 15:49 schrieb Nikita Popov: > > On Tue, Feb 4, 2020 at 3:46 PM Andreas Heigl wrote: > > > >> Hey Nikita. > >> > >> Am 04.02.20 um 15:20 schrieb Nikita Popov: > >>> On Tue, Feb 4, 2020 at 2:08 PM Nikita Popov >

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Levi Morrison via internals
Sorry if it's been said in the discussion so far, but I do not see why `print_r` should convert anything to an array. It accepts multiple kinds of types including strings, numbers, and so on, and I think adding this behavior to `print_r` is a different thing than wanting a standard way for objects

Re: [PHP-DEV] Add viable long running execution model to php 8

2020-02-04 Thread Robert Hickman
On Wed, 29 Jan 2020, 7:42 pm Peter Bowyer, wrote: > On Tue, 28 Jan 2020 at 17:12, Rowan Tommins > wrote: > > > I'd just like to point out that those two things are orthogonal: the fact > > that Swoole is distributed as an extension is not the reason it's > > incompatible with your existing code,

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Steven Wade
> Sorry if it's been said in the discussion so far, but I do not see why > `print_r` should convert anything to an array. It accepts multiple > kinds of types including strings, numbers, and so on, and I think > adding this behavior to `print_r` is a different thing than wanting a > standard way

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Chase Peeler
On Tue, Feb 4, 2020 at 11:04 AM Steven Wade wrote: > > > Sorry if it's been said in the discussion so far, but I do not see why > > `print_r` should convert anything to an array. It accepts multiple > > kinds of types including strings, numbers, and so on, and I think > > adding this behavior to

Re: [PHP-DEV] [RFC - discussion] __toArray()

2020-02-04 Thread Steven Wade
> I think the motivation is exactly what you said. Allowing developers more > control over how the object is treated when casted to an array - which would > include when it is passed into an array_* function. I couldn’t (and didn’t) have said it better myself. My motivation is really just to gi

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Larry Garfield
On Tue, Feb 4, 2020, at 6:48 AM, Aimeos | Norbert Sendetzky wrote: > I would like to modify my initial concept of an "arrayable" type because > PHP core developers seems to be in favor of the upcoming union data > types instead of adding a new "arrayable" pseudo type similar to "iterable". > > So,

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Aimeos | Norbert Sendetzky
Am 04.02.20 um 18:18 schrieb Larry Garfield: >> interface Arrayable extends ArrayAccess, Countable, Traversable >> { >> public function toArray() : array; >> } >> >> Then, methods signatures can support array and Array-like objects: >> >> function useArrayable( array|Arrayable $arg ) : array|Ar

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Rowan Tommins
On Tue, 4 Feb 2020 at 18:06, Aimeos | Norbert Sendetzky wrote: > Am 04.02.20 um 18:18 schrieb Larry Garfield: > > The more I think on it, the less I like `arrayable`. PHP arrays are > > a terrible data structure from a type system point of view, with too > > much functionality crammed into one v

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Aimeos | Norbert Sendetzky
Am 04.02.20 um 19:17 schrieb Rowan Tommins: > I think Larry's point was that the flexibility of PHP's array type makes it > really hard to pin down whether a given object is "array-like" or not, and > which attributes a particular function actually cares about. What else besides array access, coun

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Guilliam Xavier
On Tue, Feb 4, 2020 at 1:48 PM Aimeos | Norbert Sendetzky wrote: > > [...] > > interface Arrayable extends ArrayAccess, Countable, Traversable > { > public function toArray() : array; > } > > [...] > > If union data types are available and "iterable" is implemented as > alias, an alias "arraya

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Larry Garfield
On Tue, Feb 4, 2020, at 12:40 PM, Aimeos | Norbert Sendetzky wrote: > Am 04.02.20 um 19:17 schrieb Rowan Tommins: > > I think Larry's point was that the flexibility of PHP's array type makes it > > really hard to pin down whether a given object is "array-like" or not, and > > which attributes a par

Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint

2020-02-04 Thread Andreas Hennings
On Tue, 4 Feb 2020 at 22:19, Larry Garfield wrote: > On Tue, Feb 4, 2020, at 12:40 PM, Aimeos | Norbert Sendetzky wrote: > > Am 04.02.20 um 19:17 schrieb Rowan Tommins: > > > I think Larry's point was that the flexibility of PHP's array type > makes it > > > really hard to pin down whether a give