Re: [PHP-DEV] [RFC][DISCUSSION] Improve uniqid() uniqueness

2016-10-04 Thread Niklas Keller
Yasuo Ohgaki schrieb am Di., 4. Okt. 2016, 03:54: > Hi Davey, > > On Tue, Oct 4, 2016 at 4:59 AM, Davey Shafik wrote: > > On Sunday, October 2, 2016, Yasuo Ohgaki wrote: > >> > >> Hi all, > >> > >> On Mon, Oct 3, 2016 at 3:56 AM, Yasuo Ohgaki > wrote: > >> > Besides improving "more entropy" th

Re: [PHP-DEV] wordwrap with negative width

2016-10-04 Thread Niklas Keller
Yasuo Ohgaki schrieb am Di., 4. Okt. 2016, 04:43: > On Tue, Oct 4, 2016 at 11:20 AM, Stanislav Malyshev > wrote: > > I've just discovered that wordwrap() (http://php.net/wordwrap) accepts > > negative width parameter and treats it as if it was 0. It looks like a > > bug, never documented and wor

Re: [PHP-DEV] Fix ReflectionType::__toString() BC break

2016-10-04 Thread Niklas Keller
Marco Pivetta schrieb am Sa., 1. Okt. 2016, 15:27: > At the moment, the fact that it raises a fatal due to __toString() > limitations is a problem. Probably good to delay or RFC it. > You mean if errors are converted to exceptions? If you do that, deprecation warnings should usually not be conver

Re: [PHP-DEV] Add support for HTTP/1.1

2016-10-04 Thread Björn Larsson
Den 2016-10-02 kl. 23:12, skrev Rowan Collins: Hi internallers! No, you haven't misread the subject line, I'm not talking about the exciting new HTTP/2, but HTTP/1.1, 20 years old this year. To my surprise, PHP's HTTP stream wrapper (e.g. file_get_contents('http://example.com');) defaults t

[PHP-DEV] [RFC] Counting of non-countable objects

2016-10-04 Thread Craig Duncan
Hi everybody I'd like to propose the introduction of warning when counting objects that can't be counted. The default behaviour is to return 1 for these objects, which can be misleading and hide bugs when attempting to count iterable objects (eg Generators). Adding a warning would alert developer

Re: [PHP-DEV] Re: [RFC][DISCUSSION] Improve uniqid() uniqueness

2016-10-04 Thread Leigh
On 4 October 2016 at 02:39, Yasuo Ohgaki wrote: > Hi Leigh, > > On Mon, Oct 3, 2016 at 9:06 PM, Leigh wrote: >> I'm curious, did you consider using random_int? It already handles >> biasing, and you can reduce the repeated calls to random_bytes. > > Yes. It seemed it might be slower due to number

Re: [PHP-DEV] [RFC] Counting of non-countable objects

2016-10-04 Thread Leigh
On 4 October 2016 at 10:32, Craig Duncan wrote: > Hi everybody > > I'd like to propose the introduction of warning when counting objects that > can't be counted. > > The default behaviour is to return 1 for these objects, which can be > misleading and hide bugs when attempting to count iterable ob

Re: [PHP-DEV] [RFC] Counting of non-countable objects

2016-10-04 Thread Craig Duncan
On 4 October 2016 at 11:17, Leigh wrote: > You specifically mention that counting scalars is unaffected, is there > a legitimate use-case for being able to use count() on them? > > I'd say using count() on a string or an int also constitutes a hidden > bug, as it also always returns 1 regardless

[PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Pascal KISSIAN
Hi everybody, I have an application where a small file is included at multiple places. So far so good. The problem is that this include consists in a small piece of code which is inside a multi-level loop. The include is done about an average of 100.000 times . When I manually rep

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

2016-10-04 Thread Christoph M. Becker
On 04.10.2016 at 01:13, Lester Caine wrote: > On 03/10/16 22:20, Rowan Collins wrote: > >> On 3 October 2016 19:11:52 BST, Adam Baratz wrote: >> Test script: --- $db = new PDO(...); $stmt = $db->prepare("SELECT :null"); $stmt->bindValue(':null', null, PDO

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

2016-10-04 Thread Adam Baratz
> > >> Well, I'm pretty sure Postgres won't be affected either way, because > its type system is such that you can't prepare a query where the types of > parameters can't be decided yet. A query like this simply gives an error. > > > > Firebird, oracle and mysql would have exactly the same problem.

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

2016-10-04 Thread Matteo Beccati
Hi, On 04/10/2016 16:15, Adam Baratz wrote: >> Well, I'm pretty sure Postgres won't be affected either way, because >> its type system is such that you can't prepare a query where the types of >> parameters can't be decided yet. A query like this simply gives an error. >>> >>> Firebird, oracl

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Lauri Kenttä
On 2016-10-04 14:33, Pascal KISSIAN wrote: I have an application where a small file is included at multiple places. The include is done about an average of 100.000 times . I'm just wondering if you have ever heard of functions? You really should write a function, include it only once, and th

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementsletvalue dictate parameter type

2016-10-04 Thread Christoph M. Becker
On 04.10.2016 at 16:15, Adam Baratz wrote: Well, I'm pretty sure Postgres won't be affected either way, because >> its type system is such that you can't prepare a query where the types of >> parameters can't be decided yet. A query like this simply gives an error. >>> >>> Firebird, oracle an

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

2016-10-04 Thread Christoph M. Becker
On 04.10.2016 at 16:20, Matteo Beccati wrote: > Hi, > > On 04/10/2016 16:15, Adam Baratz wrote: >>> > Well, I'm pretty sure Postgres won't be affected either way, because >>> its type system is such that you can't prepare a query where the types of >>> parameters can't be decided yet. A query

RE: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Pascal KISSIAN
>-Message d'origine- >De : Lauri Kenttä [mailto:lauri.ken...@gmail.com] >Envoyé : mardi 4 octobre 2016 16:21 >À : Pascal KISSIAN >Cc : internals@lists.php.net >Objet : Re: [PHP-DEV] Feature Request: inline pseudo-instruction > >On 2016-10-04 14:33, Pascal KISSIAN wrote: >> I have an appli

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

2016-10-04 Thread Adam Baratz
> > > Well, I'm pretty sure Postgres won't be affected either way, because > >>> its type system is such that you can't prepare a query where the types > of > >>> parameters can't be decided yet. A query like this simply gives an > error. > > Firebird, oracle and mysql would have exac

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementsletvalue dictate parameter type

2016-10-04 Thread Christoph M. Becker
On 04.10.2016 at 16:44, Adam Baratz wrote: That's correct, but you can enable emulated prepares for whichever driver. A less confusing example might've been inserting :null into a nullable INT column and verifying that NULL was stored. >>> >>> That's not ture. If memory se

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementslet value dictate parameter type

2016-10-04 Thread Matteo Beccati
Hi, On 04/10/2016 16:33, Christoph M. Becker wrote: > On 04.10.2016 at 16:20, Matteo Beccati wrote: > >> Hi, >> >> On 04/10/2016 16:15, Adam Baratz wrote: >> Well, I'm pretty sure Postgres won't be affected either way, because its type system is such that you can't prepare a query w

Re: [PHP-DEV] Fwd: [PHP-BUG] Bug #73234 [NEW]: emulated statementsletvalue dictate parameter type

2016-10-04 Thread Christoph M. Becker
On 04.10.2016 at 17:00, Matteo Beccati wrote: > If you grep from PDO_ATTR_EMULATE_PREPARES you won't find anything in > core using it other than the mysql/pgsql drivers. > > It's more or less a missing feature in the other drivers. > > Back to the main topic, I agree it is a bug but we'd need to

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Thomas Hruska
On 10/4/2016 4:33 AM, Pascal KISSIAN wrote: Hi everybody, I have an application where a small file is included at multiple places. So far so good. The problem is that this include consists in a small piece of code which is inside a multi-level loop. The include is done about an average of 100

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Thomas Hruska
On 10/4/2016 7:33 AM, Pascal KISSIAN wrote: -Message d'origine- De : Lauri Kenttä [mailto:lauri.ken...@gmail.com] Envoyé : mardi 4 octobre 2016 16:21 À : Pascal KISSIAN Cc : internals@lists.php.net Objet : Re: [PHP-DEV] Feature Request: inline pseudo-instruction On 2016-10-04 14:33, Pas

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Bob Weinand
> Am 4.10.2016 um 16:33 schrieb Pascal KISSIAN : > >> -Message d'origine- >> De : Lauri Kenttä [mailto:lauri.ken...@gmail.com] >> Envoyé : mardi 4 octobre 2016 16:21 >> À : Pascal KISSIAN >> Cc : internals@lists.php.net >> Objet : Re: [PHP-DEV] Feature Request: inline pseudo-instruction

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Michał Brzuchalski
2016-10-04 17:39 GMT+02:00 Bob Weinand : > > > Am 4.10.2016 um 16:33 schrieb Pascal KISSIAN : > > > >> -Message d'origine- > >> De : Lauri Kenttä [mailto:lauri.ken...@gmail.com] > >> Envoyé : mardi 4 octobre 2016 16:21 > >> À : Pascal KISSIAN > >> Cc : internals@lists.php.net > >> Objet :

[PHP-DEV] Re: Feature Request: inline pseudo-instruction

2016-10-04 Thread Christoph M. Becker
On 04.10.2016 at 13:33, Pascal KISSIAN wrote: > I have an application where a small file is included at multiple places. > > So far so good. > > The problem is that this include consists in a small piece of code which is > inside a multi-level loop. > > The include is done about an average of 1

Re: [PHP-DEV] [RFC] Counting of non-countable objects

2016-10-04 Thread Markus Fischer
Hi, On 04.10.16 11:32, Craig Duncan wrote: > I'd like to propose the introduction of warning when counting objects that > can't be counted. > > The default behaviour is to return 1 for these objects, which can be > misleading and hide bugs when attempting to count iterable objects (eg > Generator

[PHP-DEV] Intention to move mcrypt to PECL

2016-10-04 Thread Leigh
Hello list, It is my intention to create a new PECL package for ext/mcrypt, so that it can be removed from master as per the RFC (https://wiki.php.net/rfc/mcrypt-viking-funeral) I do not expect there to be any updates to the extension after it has been migrated, however we voted to move it there.

Re: [PHP-DEV] [RFC] Counting of non-countable objects

2016-10-04 Thread Nikita Popov
On Tue, Oct 4, 2016 at 12:29 PM, Craig Duncan wrote: > On 4 October 2016 at 11:17, Leigh wrote: > > > You specifically mention that counting scalars is unaffected, is there > > a legitimate use-case for being able to use count() on them? > > > > I'd say using count() on a string or an int also c

Re: [PHP-DEV] [RFC] Counting of non-countable objects

2016-10-04 Thread Craig Duncan
On 4 October 2016 at 18:10, Nikita Popov wrote: > > A confounding factor is that count() has an alias sizeof() and for people > coming from a C-like background it is quite natural to try to apply > sizeof() to a string in order to get its length. This will silently "work", > but return a meaningl

RE: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Pascal KISSIAN
« tell me what you need, and I would tell you how to do without it » is a nonsense answer for me… I just told you about one among several cases where I found the need for such a feature. I can also tell you, by example, of a specific grammar driven php writen parser where about 100 funct

[PHP-DEV] BAD Benchmark Results for PHP Master 2016-10-04

2016-10-04 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-10-04 06:25:04+03:00 commit: 3f04ee0 previous commit:82a8e57 revision date: 2016-10-03 18:39:20-07:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

[PHP-DEV] [RFC] Bug #72811 - Replacing parse_url()

2016-10-04 Thread David Walker
Hi all, A couple weeks back I took a look at 72811[1]. The bug being that parse_url() didn't accept IPv6 addresses without a scheme, like it did for IPv4 addresses. I attempted to patch the specific bug within the scope of how parse_url() was processing URI's. After opening a PR for the resouti

[PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Michael Morris
On Tuesday, October 4, 2016, Pascal KISSIAN > wrote: > « tell me what you need, and I would tell you how to do without it » is a > nonsense answer for me… > > > > I just told you about one among several cases where I found the need for > such a feature. > > > And you've been told that functions an

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Thomas Nunninger
Hi, On 10/04/2016 01:33 PM, Pascal KISSIAN wrote: Hi everybody, I have an application where a small file is included at multiple places. So far so good. The problem is that this include consists in a small piece of code which is inside a multi-level loop. The include is done about an a

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Ryan Pallas
On Tue, Oct 4, 2016 at 8:33 AM, Pascal KISSIAN wrote: > >-Message d'origine- > >De : Lauri Kenttä [mailto:lauri.ken...@gmail.com] > >Envoyé : mardi 4 octobre 2016 16:21 > >À : Pascal KISSIAN > >Cc : internals@lists.php.net > >Objet : Re: [PHP-DEV] Feature Request: inline pseudo-instructi

Re: [PHP-DEV] Feature Request: inline pseudo-instruction

2016-10-04 Thread Ryan Pallas
On Tue, Oct 4, 2016 at 1:31 PM, Ryan Pallas wrote: > > > On Tue, Oct 4, 2016 at 8:33 AM, Pascal KISSIAN > wrote: > >> >-Message d'origine- >> >De : Lauri Kenttä [mailto:lauri.ken...@gmail.com] >> >Envoyé : mardi 4 octobre 2016 16:21 >> >À : Pascal KISSIAN >> >Cc : internals@lists.php.ne

Re: [PHP-DEV] wordwrap with negative width

2016-10-04 Thread Stanislav Malyshev
Hi! > What does drop mean? Return false and issue a warning? Keep current Yes, false + warning. -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: RFC: Strict comparisons

2016-10-04 Thread Vesa Kaihlavirta
On Mon, 19 Sep 2016 at 16:04 Vesa Kaihlavirta wrote: > Hey all, > > I've been bouncing this idea of fixing all comparison operations in one > fell swoop, although with an opt-in declare in the spirit of strict_types. > > So, I thought about this for a while, and decided against doing this RFC mys