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:
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
"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
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
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
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
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
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
"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
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
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
>
> 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,
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
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
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
>>
"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
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
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
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
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
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
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
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
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
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
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
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
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
> 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
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
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
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
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
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
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
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
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
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
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:
> >>>
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
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
> 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
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
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
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
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
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
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-
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
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
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
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
>⌊
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
>
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
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
>
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
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
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
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
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
>
> 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
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
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
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
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
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.
66 matches
Mail list logo