Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-02 Thread Sebastian Bergmann
Am 02.01.2018 um 14:37 schrieb Chris Riley: > How useful is "scalar" as a type hint? I'm not sure it provides any benefit > over "mixed". scalar has the benefit of exluding arrays, objects, and resources. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-02 Thread Chris Riley
Hi, How useful is "scalar" as a type hint? I'm not sure it provides any benefit over "mixed". Would it not be better to copy Hack and instead introduce two type hints: "num" (or "number") which is int|float and "arraykey" which is string|int? To me, these are much more useful pseudo types than

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-02 Thread Tony Marston
"Lester Caine" wrote in message news:a1bb2452-3969-ca72-cf19-4ca4bcd90...@lsces.co.uk... On 31/12/17 22:45, Michael Morris wrote: Please do not quote large swaths of Tony Marston's crap. He's an unrepentant liar, braggart and trouble maker that most of the list has on ignore since the admins

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-02 Thread Marco Pivetta
On Tue, Jan 2, 2018 at 9:28 AM, Tony Marston wrote: > "There are some of us out there who are capable of writing bug-free code" >> is a laughable argumentation anyways >> > > Why is that laughable? You appear to want to make the language more > complicated just to catch

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-02 Thread Tony Marston
wrote in message news:96908b43-e2b3-923a-5452-903f26838...@rhsoft.net... Am 01.01.2018 um 10:21 schrieb Tony Marston: Any attempt to make typehinting (or type enforcement as it has now become) is simply adding complications to the language which do not provide benefits to the greater PHP

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-01 Thread li...@rhsoft.net
Am 01.01.2018 um 10:21 schrieb Tony Marston: Any attempt to make typehinting (or type enforcement as it has now become) is simply adding complications to the language which do not provide benefits to the greater PHP community, just a minority of poor coders who want the language to trap the

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-01 Thread Michael Morris
This was supposed to go to the list as well. On Mon, Jan 1, 2018 at 6:15 AM Michael Morris wrote: > On Mon, Jan 1, 2018 at 6:01 AM Lester Caine wrote: > >> On 31/12/17 22:45, Michael Morris wrote: >> > Please do not quote large swaths of Tony Marston's

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-01 Thread Lester Caine
On 31/12/17 22:45, Michael Morris wrote: > Please do not quote large swaths of Tony Marston's crap.  He's an > unrepentant liar, braggart and trouble maker that most of the list has > on ignore since the admins can't be bothered to do their job and kick him. I'll ignore the slander ... but

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-01 Thread Tony Marston
"Dustin Wheeler" wrote in message news:a93010e9-7e52-4144-81b8-6fb6f47d8...@ncsu.edu... On Dec 31, 2017, at 10:33 AM, "li...@rhsoft.net" wrote: Am 31.12.2017 um 11:27 schrieb Tony Marston: "Michael Morris" wrote in message

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-01 Thread Tony Marston
wrote in message news:e425ecf3-4ef8-826d-bf4c-3c7b588e1...@rhsoft.net... Am 31.12.2017 um 11:27 schrieb Tony Marston: "Michael Morris" wrote in message news:CAEUnE0e67q2HMX8bmFjy5Mx8GMfxD=dnbswf9csuyntyn8x...@mail.gmail.com... On Sat, Dec 30, 2017 at 5:37 AM, Lester Caine

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2018-01-01 Thread Tony Marston
wrote in message news:7482b9d4-d487-8c0f-1f92-2e8fef68d...@rhsoft.net... Am 31.12.2017 um 11:24 schrieb Tony Marston: Some of us are clever enough to write code that doesn't have those types of bug in the first place. I developed my framework in PHP4 before type hints even existed, and I

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread Dustin Wheeler
> > On Dec 31, 2017, at 10:33 AM, "li...@rhsoft.net" wrote: > > > >> Am 31.12.2017 um 11:27 schrieb Tony Marston: >> "Michael Morris" wrote in message >> news:CAEUnE0e67q2HMX8bmFjy5Mx8GMfxD=dnbswf9csuyntyn8x...@mail.gmail.com... >>> On Sat, Dec 30, 2017 at 5:37 AM,

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread li...@rhsoft.net
Am 31.12.2017 um 11:27 schrieb Tony Marston: "Michael Morris"  wrote in message news:CAEUnE0e67q2HMX8bmFjy5Mx8GMfxD=dnbswf9csuyntyn8x...@mail.gmail.com... On Sat, Dec 30, 2017 at 5:37 AM, Lester Caine wrote: Not being able to vote, many of us have no option to

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread li...@rhsoft.net
Am 31.12.2017 um 11:24 schrieb Tony Marston: Some of us are clever enough to write code that doesn't have those types of bug in the first place. I developed my framework in PHP4 before type hints even existed, and I developed a large enterprise application with that framework which is now

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread Lester Caine
On 31/12/17 10:24, Tony Marston wrote: > wrote in message news:28ba9e6a-a3f2-2547-d294-f3a1710d5...@rhsoft.net... >> >> >> >> Am 30.12.2017 um 11:37 schrieb Lester Caine: >>> On 30/12/17 09:16, Tony Marston wrote: >> You are missing the point. If an RFC is so badly written that someone >>

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread Tony Marston
"Michael Morris" wrote in message news:CAEUnE0e67q2HMX8bmFjy5Mx8GMfxD=dnbswf9csuyntyn8x...@mail.gmail.com... On Sat, Dec 30, 2017 at 5:37 AM, Lester Caine wrote: Not being able to vote, many of us have no option to complain about the way things are going. Currently

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread Tony Marston
wrote in message news:28ba9e6a-a3f2-2547-d294-f3a1710d5...@rhsoft.net... Am 30.12.2017 um 11:37 schrieb Lester Caine: On 30/12/17 09:16, Tony Marston wrote: You are missing the point. If an RFC is so badly written that someone does not understand it, or understand what benefits it is

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-31 Thread Tony Marston
wrote in message news:320cb1b3-222b-2b21-6c39-8d9ea539b...@rhsoft.net... Am 30.12.2017 um 10:16 schrieb Tony Marston: wrote in message news:f48976dd-589f-e88e-37ba-38096c3a3...@rhsoft.net... You are missing the point. If an RFC is so badly written that someone does not understand it, or

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread li...@rhsoft.net
Am 30.12.2017 um 22:55 schrieb Michael Morris: On Sat, Dec 30, 2017 at 5:37 AM, Lester Caine wrote: Not being able to vote, many of us have no option to complain about the way things are going. Currently there seems to be several styles of PHP form the nice and simple

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread Michael Morris
On Sat, Dec 30, 2017 at 5:37 AM, Lester Caine wrote: > > Not being able to vote, many of us have no option to complain about the > way things are going. Currently there seems to be several styles of PHP > form the nice and simple untyped version I moved to from very strictly

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread li...@rhsoft.net
Am 30.12.2017 um 18:15 schrieb Sebastian Bergmann: Am 29.12.2017 um 18:30 schrieb li...@rhsoft.net: "i don't see a benefit, i don't like it" are no valid reasons to do so I strongly disagree. If a majority of people do not see the benefit of a syntax change then the syntax should not be

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread Sebastian Bergmann
Am 29.12.2017 um 16:37 schrieb Nikita Popov: > Having an explicit number type also goes well with an explicit number cast. > PHP internally has a notion of a number cast (which is the basis for > arithmetic operations), but currently does not expose it. As such, number > casts currently have to be

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread Sebastian Bergmann
Am 29.12.2017 um 18:30 schrieb li...@rhsoft.net: > "i don't see a benefit, i don't like it" are no valid reasons to do so I strongly disagree. If a majority of people do not see the benefit of a syntax change then the syntax should not be changed. A change to the syntax of PHP has a ripple effect

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread Christoph M. Becker
On 29.12.2017 at 16:37, Nikita Popov wrote: > On Fri, Dec 29, 2017 at 1:08 PM, Fleshgrinder wrote: > >> What is the use case for `int|float`? I mean, if f is able to process a >> `float` than f is able to process an `int` and since `int` is already >> automatically

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread li...@rhsoft.net
Am 30.12.2017 um 11:37 schrieb Lester Caine: On 30/12/17 09:16, Tony Marston wrote: You are missing the point. If an RFC is so badly written that someone does not understand it, or understand what benefits it is supposed to provide, then there is no point in up-voting it if i don't

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread Lester Caine
On 30/12/17 09:16, Tony Marston wrote: >>> You are missing the point. If an RFC is so badly written that someone >>> does not understand it, or understand what benefits it is supposed to >>> provide, then there is no point in up-voting it >> >> if i don't undrstand it i don't vote at all - that's

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread li...@rhsoft.net
Am 30.12.2017 um 10:16 schrieb Tony Marston: wrote in message news:f48976dd-589f-e88e-37ba-38096c3a3...@rhsoft.net... You are missing the point. If an RFC is so badly written that someone does not understand it, or understand what benefits it is supposed to provide, then there is no point in

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-30 Thread Tony Marston
wrote in message news:f48976dd-589f-e88e-37ba-38096c3a3...@rhsoft.net... Am 29.12.2017 um 09:04 schrieb Tony Marston: wrote in message news:4b55eed1-8656-ff70-e4e9-ad5e40213...@rhsoft.net... Am 29.12.2017 um 00:21 schrieb Larry Garfield: Correct. Union types I've always seen presented as

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Stephen Reay
> On 30 Dec 2017, at 00:24, Fleshgrinder wrote: > > Again, obviously, the question remains, why would you care? Really, that's what's obvious to you? What's obvious to *me* is that if a method accepts two different types of parameters, you'd want to know which was

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 18:29 schrieb Markus Fischer: On 26.12.17 16:56, Sebastian Bergmann wrote: Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: would you mind to explain this? "Foo|Bar", "array|string", etc. (still) make no sense to me. "scalar" makes sense to me although it is but an alias

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 18:24 schrieb Fleshgrinder: On 12/29/2017 6:21 PM, li...@rhsoft.net wrote: no, when i accept "int|float" i don't get something converted at all and i can handle the cases different - when it#s silently casted to a float i have no way to know it was a int at call time

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Markus Fischer
Hi all, On 26.12.17 16:56, Sebastian Bergmann wrote: Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: would you mind to explain this? "Foo|Bar", "array|string", etc. (still) make no sense to me. "scalar" makes sense to me although it is but an alias for "bool|float|int|string". I followed

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Fleshgrinder
On 12/29/2017 6:21 PM, li...@rhsoft.net wrote: > no, when i accept "int|float" i don't get something converted at all and > i can handle the cases different - when it#s silently casted to a float > i have no way to know it was a int at call time > Again, obviously, the question remains, why

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 18:13 schrieb Fleshgrinder: Why exactly is it necessary to support weak mode together with unions and intersections? It is obviously unclear in many situations what should happen, so why not simply bail like in strict mode? is also a good enough way to handle it now as we

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 18:18 schrieb Fleshgrinder: On 12/29/2017 4:09 PM, li...@rhsoft.net wrote: Am 29.12.2017 um 13:08 schrieb Fleshgrinder: What is the use case for `int|float`? I mean, if f is able to process a `float` than f is able to process an `int` and since `int` is already automatically

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Fleshgrinder
On 12/29/2017 4:09 PM, li...@rhsoft.net wrote: > > Am 29.12.2017 um 13:08 schrieb Fleshgrinder: >> What is the use case for `int|float`? I mean, if f is able to process a >> `float` than f is able to process an `int` and since `int` is already >> automatically changed to a `float`, well, you're

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Fleshgrinder
On 12/29/2017 4:37 PM, Nikita Popov wrote: > int|float is the natural type of numeric operations in PHP. Integers > automatically overflow into floating point numbers, so signatures using int > in conjunction with numeric operations are somewhat problematic. > > Having an explicit number type

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 16:37 schrieb Nikita Popov: Regarding the union type RFCs, from what I remember, one of my personal issues with it were the complex rules involving scalar type unions in weak typing mode. It's non-trivial to decide what a value should be casted to if it does not have the

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Nikita Popov
On Fri, Dec 29, 2017 at 1:08 PM, Fleshgrinder wrote: > On 12/29/2017 12:21 AM, Larry Garfield wrote: > > On Wednesday, December 27, 2017 3:50:54 AM CST Rowan Collins wrote: > >> On 26 December 2017 18:35:29 GMT+00:00, "li...@rhsoft.net" > > wrote: > >>>

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 13:08 schrieb Fleshgrinder: What is the use case for `int|float`? I mean, if f is able to process a `float` than f is able to process an `int` and since `int` is already automatically changed to a `float`, well, you're done just read the mass of bugreports caused by float

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Larry Garfield
On Friday, December 29, 2017 8:20:14 AM CST Stephen Reay wrote: > > On 29 Dec 2017, at 19:56, Fleshgrinder wrote: > >> On 12/29/2017 1:26 PM, Rowan Collins wrote: > >> On 29 December 2017 12:08:16 GMT+00:00, Fleshgrinder > >> > >> wrote: > >>> What

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Stephen Reay
> On 29 Dec 2017, at 19:56, Fleshgrinder wrote: > >> On 12/29/2017 1:26 PM, Rowan Collins wrote: >> On 29 December 2017 12:08:16 GMT+00:00, Fleshgrinder >> wrote: >>> What is the use case for `int|float`? I mean, if f is able to >>> process a

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread li...@rhsoft.net
Am 29.12.2017 um 09:04 schrieb Tony Marston: wrote in message news:4b55eed1-8656-ff70-e4e9-ad5e40213...@rhsoft.net... Am 29.12.2017 um 00:21 schrieb Larry Garfield: Correct.  Union types I've always seen presented as offering both union and intersection.  There are cases where union is

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Fleshgrinder
On 12/29/2017 1:26 PM, Rowan Collins wrote: > On 29 December 2017 12:08:16 GMT+00:00, Fleshgrinder > wrote: >> What is the use case for `int|float`? I mean, if f is able to >> process a `float` than f is able to process an `int` and since >> `int` is already automatically

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Rowan Collins
On 29 December 2017 12:08:16 GMT+00:00, Fleshgrinder wrote: >What is the use case for `int|float`? I mean, if f is able to process a >`float` than f is able to process an `int` and since `int` is already >automatically changed to a `float`, well, you're done. I think it

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Fleshgrinder
On 12/29/2017 12:21 AM, Larry Garfield wrote: > On Wednesday, December 27, 2017 3:50:54 AM CST Rowan Collins wrote: >> On 26 December 2017 18:35:29 GMT+00:00, "li...@rhsoft.net" > wrote: >>> Am 26.12.2017 um 19:18 schrieb Larry Garfield: If I may, I think the argument has

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-29 Thread Tony Marston
wrote in message news:4b55eed1-8656-ff70-e4e9-ad5e40213...@rhsoft.net... Am 29.12.2017 um 00:21 schrieb Larry Garfield: Correct. Union types I've always seen presented as offering both union and intersection. There are cases where union is great, and where it's kinda silly. There are

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-28 Thread li...@rhsoft.net
Am 29.12.2017 um 00:21 schrieb Larry Garfield: Correct. Union types I've always seen presented as offering both union and intersection. There are cases where union is great, and where it's kinda silly. There are cases where intersect is great, and where it's kinda silly. Most of the anti-

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-28 Thread Larry Garfield
On Wednesday, December 27, 2017 3:50:54 AM CST Rowan Collins wrote: > On 26 December 2017 18:35:29 GMT+00:00, "li...@rhsoft.net" wrote: > >Am 26.12.2017 um 19:18 schrieb Larry Garfield: > >> If I may, I think the argument has always been that > >> > >> 1) Foo & Bar makes total

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-27 Thread Rowan Collins
On 26 December 2017 18:35:29 GMT+00:00, "li...@rhsoft.net" wrote: > > >Am 26.12.2017 um 19:18 schrieb Larry Garfield: >> If I may, I think the argument has always been that >> >> 1) Foo & Bar makes total sense >> 2) int|float makes total sense >> 3) int & string is illogical

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread li...@rhsoft.net
Am 26.12.2017 um 20:15 schrieb Sara Golemon: On Tue, Dec 26, 2017 at 10:56 AM, Sebastian Bergmann wrote: Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: would you mind to explain this? "Foo|Bar", "array|string", etc. (still) make no sense to me. "scalar" makes sense to

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Fleshgrinder
On 12/26/2017 5:20 PM, Alexander Lisachenko wrote: > In some distant future it could be implemented in more natural way with > classes for primitive types and automatic boxing/unboxing for primitive > built-in types: > > Php\Type\Object > Php\Type\Scalar >⌊ Php\Type\String >⌊

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Sara Golemon
On Tue, Dec 26, 2017 at 10:56 AM, Sebastian Bergmann wrote: > Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: >> would you mind to explain this? > > "Foo|Bar", "array|string", etc. (still) make no sense to me. > > "scalar" makes sense to me although it is but an alias for >

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread li...@rhsoft.net
Am 26.12.2017 um 19:18 schrieb Larry Garfield: On Tuesday, December 26, 2017 9:56:21 AM CST Sebastian Bergmann wrote: Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: would you mind to explain this? "Foo|Bar", "array|string", etc. (still) make no sense to me. "scalar" makes sense to me

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Larry Garfield
On Tuesday, December 26, 2017 9:56:21 AM CST Sebastian Bergmann wrote: > Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: > > would you mind to explain this? > > "Foo|Bar", "array|string", etc. (still) make no sense to me. > > "scalar" makes sense to me although it is but an alias for >

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Alexander Lisachenko
In some distant future it could be implemented in more natural way with classes for primitive types and automatic boxing/unboxing for primitive built-in types: Php\Type\Object Php\Type\Scalar ⌊ Php\Type\String ⌊ Php\Type\Integer ⌊ Php\Type\Float ⌊ Php\Type\Boolean Php\Type\Array And

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread li...@rhsoft.net
Am 26.12.2017 um 16:56 schrieb Sebastian Bergmann: Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: would you mind to explain this? "Foo|Bar", "array|string", etc. (still) make no sense to me. "scalar" makes sense to me although it is but an alias for "bool|float|int|string". honestly

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Andreas Heigl
Hey All. > Am 26.12.2017 um 14:38 schrieb Sebastian Bergmann : > >> Am 24.12.2017 um 15:34 schrieb Fleshgrinder: >> I prepared a PR to add the `scalar` pseudo-type to PHP after the >> discussions around adding a `mixed` pseudo-type. I strongly believe that >> it makes sense

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Sebastian Bergmann
Am 26.12.2017 um 16:46 schrieb li...@rhsoft.net: > would you mind to explain this? "Foo|Bar", "array|string", etc. (still) make no sense to me. "scalar" makes sense to me although it is but an alias for "bool|float|int|string". -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread li...@rhsoft.net
Am 26.12.2017 um 14:38 schrieb Sebastian Bergmann: Thank you, Richard, for working on this. I spent a lot of time this year introducing scalar type declarations into existing code bases. In quite a few cases I was not able to do so because the existing code works with parameters that can be

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Niklas Keller
> > Am 24.12.2017 um 15:34 schrieb Fleshgrinder: > > I prepared a PR to add the `scalar` pseudo-type to PHP after the > > discussions around adding a `mixed` pseudo-type. I strongly believe that > > it makes sense to provide the most common primitive union types with > > handy aliases even if we

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-26 Thread Sebastian Bergmann
Am 24.12.2017 um 15:34 schrieb Fleshgrinder: > I prepared a PR to add the `scalar` pseudo-type to PHP after the > discussions around adding a `mixed` pseudo-type. I strongly believe that > it makes sense to provide the most common primitive union types with > handy aliases even if we are going to

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-24 Thread Fleshgrinder
On 12/24/2017 5:42 PM, Fleshgrinder wrote: > I will extend it with some examples. > > I guess that that would be useful in weak mode. Will try to hack it in. > > I am currently also working on another RFC that adds a `Convertible` > interface with a single `into` method that has its return type

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-24 Thread Fleshgrinder
On 12/24/2017 5:30 PM, Nikita Popov wrote: > I think this RFC could benefit from displaying some use-cases for this type > annotation. I can't recall any recent instance where I would have found > this specific type combination useful, though I'm sure there are good > examples. > > I also wonder

Re: [PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-24 Thread Nikita Popov
On Sun, Dec 24, 2017 at 3:34 PM, Fleshgrinder wrote: > Hi Internals! > > I prepared a PR to add the `scalar` pseudo-type to PHP after the > discussions around adding a `mixed` pseudo-type. I strongly believe that > it makes sense to provide the most common primitive union

[PHP-DEV] [RFC] [DISCUSSION] Scalar Pseudo-type

2017-12-24 Thread Fleshgrinder
Hi Internals! I prepared a PR to add the `scalar` pseudo-type to PHP after the discussions around adding a `mixed` pseudo-type. I strongly believe that it makes sense to provide the most common primitive union types with handy aliases even if we are going to add union types in the future to PHP.