[PHP-DEV] UGLY Benchmark Results for PHP Master 2017-03-08

2017-03-08 Thread lp_benchmark_robot
Results for project PHP master, build date 2017-03-08 20:14:30-08:00 commit: 2ba2b76 previous commit:c698299 revision date: 2017-03-07 12:11:31-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-08 Thread Stanislav Malyshev
Hi! > I submitted a GitHub PR* to allow objects implementing __toString() to > *optionally* pass is_string() validation. More verbose wording of my > motivation can be seen in the PR description, but here are the main > points: I don't think it's right approach. is_* functions check the current

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

2017-03-08 Thread Fleshgrinder
On 3/9/2017 12:32 AM, Andrey Andreev wrote: > On Thu, Mar 9, 2017 at 12:42 AM, Rowan Collins > wrote: >> >> I still don't understand what you're using this check for that means you >> want to exclude integers. If you're passing on the value to anything that >> actually

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

2017-03-08 Thread Andrey Andreev
On Thu, Mar 9, 2017 at 12:42 AM, Rowan Collins wrote: > > I still don't understand what you're using this check for that means you > want to exclude integers. If you're passing on the value to anything that > actually needs a string, you're doing a string cast, either

[PHP-DEV] [VOTE] Extended String Types For PDO

2017-03-08 Thread Adam Baratz
Hi, I'd like to open the vote on this RFC: https://wiki.php.net/rfc/extended-string-types-for-pdo Previous discussion: https://externals.io/thread/715 Voting will end on the 17th at 0:00 UTC. Thanks, Adam

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

2017-03-08 Thread Fleshgrinder
On 3/8/2017 11:24 PM, Andrey Andreev wrote: > Hi again, > > On Wed, Mar 8, 2017 at 9:39 PM, Rowan Collins wrote: >> >> I think it comes down to what you're trying to achieve: the language can't >> have pseudo-types for every possible combination of types, so if you want

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

2017-03-08 Thread Andrey Andreev
Hi Andrea, On Wed, Mar 8, 2017 at 8:44 PM, Andrea Faulds wrote: > Fleshgrinder wrote: >> >> On 3/8/2017 7:36 PM, Andrea Faulds wrote: >>> >>> Hi, >>> >>> Andrey Andreev wrote: The question is rather "is this value a string?", only with the added assumption that

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

2017-03-08 Thread Rowan Collins
On 08/03/2017 22:24, Andrey Andreev wrote: This is why I was concerned about the discussion becoming too broad - it brings us (or me anyway) back to square 1, if not even out of bounds. Sorry :( I do agree that we can't have pseudo-types for everything, but can we at least have meaningful

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

2017-03-08 Thread Andrey Andreev
Hi again, On Wed, Mar 8, 2017 at 9:39 PM, Rowan Collins wrote: > > I think it comes down to what you're trying to achieve: the language can't > have pseudo-types for every possible combination of types, so if you want to > detect integers as one case, and other things

[PHP-DEV] [RFC][VOTE] Deprecate and Remove Bareword (Unquoted) Strings

2017-03-08 Thread Rowan Collins
Hi all, As there has been no further feedback since my last update, and it is 5 weeks since I first placed it Under Discussion, I would like to move ahead with voting on my RFC to Deprecate and Remove Bareword (Unquoted) Strings. Voting will close on 2017-03-22, at 22:00 UTC, i.e. two weeks

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

2017-03-08 Thread Rowan Collins
Hi Richard, Please note that I had drafted this before I saw your last e-mail, so I think some of its points are now redundant. I'm sending it anyway, in case it helps with further thoughts. On 08/03/2017 15:44, Fleshgrinder wrote: We can coerce an integer to a string but an integer is not

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

2017-03-08 Thread Fleshgrinder
On 3/8/2017 7:50 PM, Nikita Popov wrote: > On Wed, Mar 8, 2017 at 7:44 PM, Andrea Faulds wrote: > >> Fleshgrinder wrote: >> >>> On 3/8/2017 7:36 PM, Andrea Faulds wrote: >>> Hi, Andrey Andreev wrote: > The question is rather "is this value a string?", only

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

2017-03-08 Thread Nikita Popov
On Wed, Mar 8, 2017 at 7:44 PM, Andrea Faulds wrote: > Fleshgrinder wrote: > >> On 3/8/2017 7:36 PM, Andrea Faulds wrote: >> >>> Hi, >>> >>> Andrey Andreev wrote: >>> The question is rather "is this value a string?", only with the added assumption that __toString() objects

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

2017-03-08 Thread Andrea Faulds
Fleshgrinder wrote: On 3/8/2017 7:36 PM, Andrea Faulds wrote: Hi, Andrey Andreev wrote: The question is rather "is this value a string?", only with the added assumption that __toString() objects are treated as "string objects" and thus fulfill the condition (another reason why I went for an

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

2017-03-08 Thread Fleshgrinder
On 3/8/2017 7:36 PM, Andrea Faulds wrote: > Hi, > > Andrey Andreev wrote: >> The question is rather "is this value a string?", only with the added >> assumption that __toString() objects are treated as "string objects" >> and thus fulfill the condition (another reason why I went for an >>

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

2017-03-08 Thread Andrea Faulds
Hi, Andrey Andreev wrote: The question is rather "is this value a string?", only with the added assumption that __toString() objects are treated as "string objects" and thus fulfill the condition (another reason why I went for an is_string() parameter). This is a faulty assumption. The

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

2017-03-08 Thread Fleshgrinder
On 3/8/2017 5:50 PM, Ryan Pallas wrote: > On Wed, Mar 8, 2017 at 9:50 AM, Ryan Pallas wrote: > >> >> >> On Wed, Mar 8, 2017 at 8:51 AM, Fleshgrinder wrote: >> >>> Hey! :) >>> >>> The reference is actually not a problem for a Stringable because you

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

2017-03-08 Thread Ryan Pallas
On Wed, Mar 8, 2017 at 9:50 AM, Ryan Pallas wrote: > > > On Wed, Mar 8, 2017 at 8:51 AM, Fleshgrinder wrote: > >> Hey! :) >> >> The reference is actually not a problem for a Stringable because you >> would get the "Only variables can be passed by

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

2017-03-08 Thread Ryan Pallas
On Wed, Mar 8, 2017 at 8:51 AM, Fleshgrinder wrote: > Hey! :) > > The reference is actually not a problem for a Stringable because you > would get the "Only variables can be passed by reference" error with an > object if `strict_types` is enabled. > > Simply because the

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

2017-03-08 Thread Fleshgrinder
Hey! :) The reference is actually not a problem for a Stringable because you would get the "Only variables can be passed by reference" error with an object if `strict_types` is enabled. Simply because the object **MUST** be converted into a string. The object itself does not satisfy the

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

2017-03-08 Thread Fleshgrinder
Hey guys! The question if an integer is a stringable is pretty much the same as the question if an stdClass is an iterable. Sure, you can iterate an stdClass instance with a foreach, but does it qualify as an iterable? Definitely not, and luckily it was not implemented as such. We can coerce an

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

2017-03-08 Thread Andrey Andreev
Hi Ryan, On Wed, Mar 8, 2017 at 5:15 PM, Ryan Pallas wrote: > Sorry, accidently sent in the middle of typing that... > > On Wed, Mar 8, 2017 at 7:42 AM, Ryan Pallas wrote: >> >> >> >> On Wed, Mar 8, 2017 at 5:25 AM, Andrey Andreev

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

2017-03-08 Thread Ryan Pallas
Sorry, accidently sent in the middle of typing that... On Wed, Mar 8, 2017 at 7:42 AM, Ryan Pallas wrote: > > > On Wed, Mar 8, 2017 at 5:25 AM, Andrey Andreev wrote: > >> Hi all, >> >> I submitted a GitHub PR* to allow objects implementing __toString()

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

2017-03-08 Thread Andrey Andreev
Hi Rowan, On Wed, Mar 8, 2017 at 4:29 PM, Rowan Collins wrote: > Hi Andrey, > > I think this is an interesting area to explore, but do think the scope needs > to be widened slightly. > > > On 8 March 2017 12:25:54 GMT+00:00, Andrey Andreev wrote: >>I

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

2017-03-08 Thread Larry Garfield
On 03/08/2017 06:25 AM, Andrey Andreev wrote: Hi all, I submitted a GitHub PR* to allow objects implementing __toString() to *optionally* pass is_string() validation. More verbose wording of my motivation can be seen in the PR description, but here are the main points: - Simpler way to do

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

2017-03-08 Thread Ryan Pallas
On Wed, Mar 8, 2017 at 5:25 AM, Andrey Andreev wrote: > Hi all, > > I submitted a GitHub PR* to allow objects implementing __toString() to > *optionally* pass is_string() validation. More verbose wording of my > motivation can be seen in the PR description, but here are the

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

2017-03-08 Thread Rowan Collins
Hi Andrey, I think this is an interesting area to explore, but do think the scope needs to be widened slightly. On 8 March 2017 12:25:54 GMT+00:00, Andrey Andreev wrote: >I ultimately wouldn't care if it's a separate function and did in fact >think of an is_stringable()

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

2017-03-08 Thread Andrey Andreev
Hi all, I submitted a GitHub PR* to allow objects implementing __toString() to *optionally* pass is_string() validation. More verbose wording of my motivation can be seen in the PR description, but here are the main points: - Simpler way to do checks like: is_string($var) || method_exists($var,

Re: [PHP-DEV] generating code from AST

2017-03-08 Thread Nikita Nefedov
> On 8 Mar 2017, at 08:49, Sebastian Bergmann wrote: > > Am 07.03.2017 um 11:33 schrieb Derick Rethans: >> Because installing an extension is too hard? > > No. To ensure that userland functionality that is based on compiler > internals (token stream, abstract syntax tree,

[PHP-DEV] ZipArchive::addGlob with remove_path option overcuts filepath

2017-03-08 Thread tyage
Hi internals, I created a bug report ( https://bugs.php.net/bug.php?id=72374 ) and PR( https://github.com/php/php-src/pull/1939 ) that will change the behavior of ZipArchive::addGlob method. Currently, this method cuts the file path more than the length given by remove_path option and strips the

Re: [PHP-DEV] generating code from AST

2017-03-08 Thread Sebastian Bergmann
Am 07.03.2017 um 11:33 schrieb Derick Rethans: > Because installing an extension is too hard? No. To ensure that userland functionality that is based on compiler internals (token stream, abstract syntax tree, bytecode) does not fall out of sync with the compiler. We already have an extension