Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Xinchen Hui
Hey: On Thu, Dec 25, 2014 at 12:38 PM, Pierre Joye wrote: > On Thu, Dec 25, 2014 at 3:06 PM, Andrea Faulds wrote: >> >>> On 24 Dec 2014, at 23:53, Levi Morrison wrote: >>> >>> On Wed, Dec 24, 2014 at 4:27 PM, Johannes Schlüter >>> wrote: On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison wr

Re: [PHP-DEV] Proposal for PHP 7 : case-sensitive symbols

2014-12-24 Thread Pierre Joye
Hi François, On Thu, Dec 25, 2014 at 2:40 PM, François Laupretre wrote: >> > De : Pierre Joye [mailto:pierre@gmail.com] >> >> > Anyone dying while waiting to see PHP having case sensitive symbols >> > handling should go ahead with a RFC. > > For those interested, I just created a PR to raise

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Pierre Joye
On Thu, Dec 25, 2014 at 3:34 PM, Xinchen Hui wrote: > Hey: > > On Thu, Dec 25, 2014 at 12:06 PM, Andrea Faulds wrote: >> >>> On 24 Dec 2014, at 23:53, Levi Morrison wrote: >>> >>> On Wed, Dec 24, 2014 at 4:27 PM, Johannes Schlüter >>> wrote: On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Pierre Joye
On Thu, Dec 25, 2014 at 3:06 PM, Andrea Faulds wrote: > >> On 24 Dec 2014, at 23:53, Levi Morrison wrote: >> >> On Wed, Dec 24, 2014 at 4:27 PM, Johannes Schlüter >> wrote: >>> On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison wrote: >>> I'm asking for specific things. The reason is that som

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Xinchen Hui
Hey: On Thu, Dec 25, 2014 at 12:06 PM, Andrea Faulds wrote: > >> On 24 Dec 2014, at 23:53, Levi Morrison wrote: >> >> On Wed, Dec 24, 2014 at 4:27 PM, Johannes Schlüter >> wrote: >>> On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison wrote: >>> I'm asking for specific things. The reason is t

RE: [PHP-DEV] Proposal for PHP 7 : case-sensitive symbols

2014-12-24 Thread François Laupretre
> > De : Pierre Joye [mailto:pierre@gmail.com] > > > Anyone dying while waiting to see PHP having case sensitive symbols > > handling should go ahead with a RFC. For those interested, I just created a PR to raise an E_STRICT message on class and function/method case mismatch : https://githu

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Andrea Faulds
> On 24 Dec 2014, at 23:53, Levi Morrison wrote: > > On Wed, Dec 24, 2014 at 4:27 PM, Johannes Schlüter > wrote: >> On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison wrote: >> >>> I'm asking for specific things. The reason is that some API's do a >>> non-zero error code; the fact that they are

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Levi Morrison
On Wed, Dec 24, 2014 at 4:27 PM, Johannes Schlüter wrote: > On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison wrote: > >> I'm asking for specific things. The reason is that some API's do a >> non-zero error code; the fact that they are negative is a detail that >> we should not need to care about.

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Johannes Schlüter
On Wed, 2014-12-24 at 11:13 -0700, Levi Morrison wrote: > I'm asking for specific things. The reason is that some API's do a > non-zero error code; the fact that they are negative is a detail that > we should not need to care about. My guess is that positive values more often might have a meaning

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Andrea Faulds
> On 24 Dec 2014, at 18:13, Levi Morrison wrote: > > On Wed, Dec 24, 2014 at 10:34 AM, Andrea Faulds wrote: >> >>> On 24 Dec 2014, at 17:22, Levi Morrison wrote: >>> >>> Hmm. This thread doesn't seem to mention it, but why must failure be >>> negative? I understand the non-zero part but not

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Pierre Joye
On Dec 25, 2014 1:13 AM, "Levi Morrison" wrote: > > On Wed, Dec 24, 2014 at 10:34 AM, Andrea Faulds wrote: > > > >> On 24 Dec 2014, at 17:22, Levi Morrison wrote: > >> > >> Hmm. This thread doesn't seem to mention it, but why must failure be > >> negative? I understand the non-zero part but not

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Levi Morrison
On Wed, Dec 24, 2014 at 10:34 AM, Andrea Faulds wrote: > >> On 24 Dec 2014, at 17:22, Levi Morrison wrote: >> >> Hmm. This thread doesn't seem to mention it, but why must failure be >> negative? I understand the non-zero part but not negative. Aside from >> the fact we probably have code relying

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Andrea Faulds
> On 24 Dec 2014, at 17:22, Levi Morrison wrote: > > Hmm. This thread doesn't seem to mention it, but why must failure be > negative? I understand the non-zero part but not negative. Aside from > the fact we probably have code relying on it to be negative at this > point is there some other reas

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Levi Morrison
Hmm. This thread doesn't seem to mention it, but why must failure be negative? I understand the non-zero part but not negative. Aside from the fact we probably have code relying on it to be negative at this point is there some other reason? -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Pierre Joye
On Dec 24, 2014 8:41 PM, "Johannes Schlüter" wrote: > > On Wed, 2014-12-24 at 05:06 +, Andrea Faulds wrote: > > typedef enum _zend_success { > > FAILURE = 0, > > SUCCESS = 1 > > } zend_success; > > mysqlnd uses a enum for that already. See > http://lxr.php.net/xref/PHP_TRUNK/ext/mysqln

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Johannes Schlüter
On Wed, 2014-12-24 at 05:06 +, Andrea Faulds wrote: > typedef enum _zend_success { > FAILURE = 0, > SUCCESS = 1 > } zend_success; mysqlnd uses a enum for that already. See http://lxr.php.net/xref/PHP_TRUNK/ext/mysqlnd/mysqlnd_enum_n_def.h#139 If a PHP-wide thing is introduced this sho

Re: [PHP-DEV] Line profiler for PHP

2014-12-24 Thread Derick Rethans
On Tue, 23 Dec 2014, Stanislav Malyshev wrote: > > The questions I have are: - Is this even possible? > > Yes, should be possible but: > 1. If you want precision, it would slow down your code a lot, as > basically you need to record timing of each opcode, which can be very > expensive. > 2. If yo

Re: [PHP-DEV] JSON HASHDOS

2014-12-24 Thread Patrick Schaaf
Hi all, Am 24.12.2014 10:47 schrieb "Yasuo Ohgaki" : > > On Wed, Dec 24, 2014 at 6:29 PM, Pierre Joye wrote: > > > I do not see how it solves the problem. It only reduces it, slightly. > > Having a couple of medium instances generating crafted requests will > > just have the same effect. So far t

Re: [PHP-DEV] JSON HASHDOS

2014-12-24 Thread Yasuo Ohgaki
Hi, On Wed, Dec 24, 2014 at 6:29 PM, Pierre Joye wrote: > I do not see how it solves the problem. It only reduces it, slightly. > Having a couple of medium instances generating crafted requests will > just have the same effect. So far the more realistic suggestions are > about having collision s

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Pierre Joye
On Wed, Dec 24, 2014 at 7:53 PM, Xinchen Hui wrote: > On Wed, Dec 24, 2014 at 3:57 PM, Pierre Joye wrote: >> >> On Dec 24, 2014 2:38 PM, "Stanislav Malyshev" wrote: >>> >>> Hi! >>> >>> > But: return 0 and return FAILURE... which is simpler? >>> >>> It's equally simple to write, but FAILURE of c

Re: [PHP-DEV] JSON HASHDOS

2014-12-24 Thread Pierre Joye
hi, On Wed, Dec 24, 2014 at 7:37 PM, Yasuo Ohgaki wrote: > Hi Pierre, > > On Wed, Dec 24, 2014 at 4:23 PM, Pierre Joye wrote: >> >> Please keep in mind that this problem is: >> >> . not json specific >> . not specific at runtime but could also happen before a script get the >> hand >> >> A rando

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Xinchen Hui
On Wed, Dec 24, 2014 at 3:57 PM, Pierre Joye wrote: > > On Dec 24, 2014 2:38 PM, "Stanislav Malyshev" wrote: >> >> Hi! >> >> > But: return 0 and return FAILURE... which is simpler? >> >> It's equally simple to write, but FAILURE of course is way simpler to >> understand when read. > > I totally

Re: [PHP-DEV] About SUCCESS/FAILURE

2014-12-24 Thread Xinchen Hui
Hey: On Wed, Dec 24, 2014 at 3:38 PM, Stanislav Malyshev wrote: > Hi! > >> But: return 0 and return FAILURE... which is simpler? > > It's equally simple to write, but FAILURE of course is way simpler to > understand when read. I can not agree with that since nowdays, false === 0, true === 1 is

Re: [PHP-DEV] JSON HASHDOS

2014-12-24 Thread Yasuo Ohgaki
Hi Pierre, On Wed, Dec 24, 2014 at 4:23 PM, Pierre Joye wrote: > Please keep in mind that this problem is: > > . not json specific > . not specific at runtime but could also happen before a script get the > hand > > A randomized hash only postpone the issue but won't solve it. > > I fear that a