Re: [PHP-DEV] [Discussion] is_string(), string type and objectsimplementing __toString()

2017-03-10 Thread Christoph M. Becker
On 09.03.2017 at 21:09, Rowan Collins wrote: > On 08/03/2017 23:32, Andrey Andreev wrote: > >> For example, a Cookie object may have the cookie attributes (domain, >> path, etc.) as value objects, but they can easily be created from raw >> strings, while other types would be ambiguous. >> A

Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString()

2017-03-10 Thread Andrey Andreev
Hi, On Thu, Mar 9, 2017 at 7:47 PM, Fleshgrinder wrote: > On 3/9/2017 12:47 PM, Andrey Andreev wrote: >> How can "any other scalar value" work? Using the cookie and headers examples: >> >> - booleans can be used as On/Off flags for the secure and httpOnly >> cookie

Re: [PHP-DEV] Proposing a new 'cache_key' streams operation

2017-03-10 Thread François Laupretre
Hi, Le 09/03/2017 à 19:58, Adam Baratz a écrit : Thanks for sharing this. Very interesting idea. Have you posted an RFC yet? That'll help lay out the bigger questions and guide the conversation. There are some notes here if you haven't done one before: https://wiki.php.net/rfc/howto I am

Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString()

2017-03-10 Thread Andrey Andreev
On Fri, Mar 10, 2017 at 4:20 PM, Rowan Collins wrote: > On 10 March 2017 10:57:42 GMT+00:00, Andrey Andreev wrote: >>I'm not really interested in making "strict mode" less strict - it's >>already opt-in and non-enforceable. >>I want ways to write

Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString()

2017-03-10 Thread Rowan Collins
On 10 March 2017 10:57:42 GMT+00:00, Andrey Andreev wrote: >I'm not really interested in making "strict mode" less strict - it's >already opt-in and non-enforceable. >I want ways to write stonger-type code in "non-strict mode", because >the fact that "strict mode" is

Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString()

2017-03-10 Thread Rowan Collins
On 10 March 2017 15:11:39 GMT+00:00, Andrey Andreev wrote: >Let's say I asked for one of 3 class constants, that happen to hold >integer values, and you gave me a string that just happens to be >castable to one of those values - you obviously aren't using my API >correctly, but

Re: [PHP-DEV] Re: [RFC] Extended String Types For PDO

2017-03-10 Thread Matteo Beccati
On 10/03/2017 16:53, Adam Baratz wrote: > I meant that this change won't break existing code. But yes, others may > need to modify their code to be compatible with this new feature. Within > pdo, a bitmask is applied -- see uses of the PDO_PARAM_TYPE macro. It's > probably worth replicating that

Re: [PHP-DEV] Re: [RFC] Extended String Types For PDO

2017-03-10 Thread Adam Baratz
> > I've read the links, hence my skepticism and me labeling this as "yet > another way that SQL Server decides to make things harder and buggy". It is > a bug in SQL Server, unless I'm missing the reason for this to exist (or > maybe there was such a reason in 1991). > One of the links is MySQL

Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString()

2017-03-10 Thread Stanislav Malyshev
Hi! > This is not true at all: > > 1. is_dir Oh come on. I assumed I don't need to explain that the context was about is_* functions for types, not every function that starts with is_*. It doesn't even make sense to compare is_string to is_dir. -- Stas Malyshev smalys...@gmail.com -- PHP

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2017-03-09

2017-03-10 Thread lp_benchmark_robot
Results for project PHP master, build date 2017-03-09 20:29:46-08:00 commit: dde62b1 previous commit:f68968f revision date: 2017-03-09 11:58:19-08:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] [Discussion] is_string(), string type and objects implementing __toString()

2017-03-10 Thread Andrey Andreev
Hi Rowan, On Thu, Mar 9, 2017 at 10:09 PM, Rowan Collins wrote: > On 08/03/2017 23:32, Andrey Andreev wrote: >> >> For example, a Cookie object may have the cookie attributes (domain, >> path, etc.) as value objects, but they can easily be created from raw >> strings,

[PHP-DEV] Type variants

2017-03-10 Thread Michael Vostrikov
Hello. I have an idea which seems rather useful. I would like to know your opinion, Let's say we have class Rectangle and need to have class Square which will be used in some operations. We don't need any rectangle, this must be only square. What if we could describe a type which is the same as