Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Stanislav Malyshev
Hi! > Would anyone be interested in adding another helper like > isset()/empty() simply called exists() which would return true if the > variable is defined in the current scope (i.e. without raising an > E_NOTICE)? Not sure what the use case would be for this. For most practical purposes, isset/

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Marco Pivetta
You are probably looking for something like `array_key_exists($varName, get_defined_vars());`: https://3v4l.org/XagEA Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 26 August 2015 at 04:26, Sherif Ramadan wrote: > I get that it exists. I'm asking what is the usefulne

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Sherif Ramadan
I get that it exists. I'm asking what is the usefulness of having a function that tells you the variable is null? In theory this sounds great and is actually very doable by checking the symbol table for the hash. However, in practice, who actually has a use for this? Null is a special value in PHP,

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Scott Arciszewski
Because $x exists. https://3v4l.org/kUJtP Scott Arciszewski Chief Development Officer Paragon Initiative Enterprises On Tue, Aug 25, 2015 at 11:16 PM, Sherif Ramadan wrote: > Yes, because all undefined variables in PHP are implicitly null. As far as > PHP is concerned, if it's null, it's by def

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Sherif Ramadan
Yes, because all undefined variables in PHP are implicitly null. As far as PHP is concerned, if it's null, it's by definition _not defined_. Also, still not seeing where a NOTICE is involved here? Those functions never give errors. What is the usefulness of a function that merely returns true when

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Scott Arciszewski
On Tue, Aug 25, 2015 at 11:11 PM, Sherif Ramadan wrote: > That's exactly what isset() does. isset/empty never raise errors. > > On Tue, Aug 25, 2015 at 11:09 PM, Scott Arciszewski > wrote: >> >> Hi everybody, >> >> Would anyone be interested in adding another helper like >> isset()/empty() simply

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Sherif Ramadan
That's exactly what isset() does. isset/empty never raise errors. On Tue, Aug 25, 2015 at 11:09 PM, Scott Arciszewski wrote: > Hi everybody, > > Would anyone be interested in adding another helper like > isset()/empty() simply called exists() which would return true if the > variable is defined

[PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-08-25 Thread Scott Arciszewski
Hi everybody, Would anyone be interested in adding another helper like isset()/empty() simply called exists() which would return true if the variable is defined in the current scope (i.e. without raising an E_NOTICE)? It should be a simple change to add this function but it's too late for 7.0 so,

Re: [PHP-DEV] Notice on non existing array key (on a boolean)

2015-08-25 Thread Sherif Ramadan
Hmmm... I'm not really sure whether to consider this a language change or not. I mean no syntax has changed, but sure it does break BC because of the new notice. I'm really dubious about whether or not this demands an RFC. I've seen more sweeping changes make it into a release with less discussion

Re: [PHP-DEV] Notice on non existing array key (on a boolean)

2015-08-25 Thread AllenJB
I have a pull request pending on this bug: https://github.com/php/php-src/pull/1269 It's been discussed before ("Array dereferencing of scalars", 10th June 2015 - I'm pretty sure it was discussed at least once more since then too) and I was basically told it would require an RFC to get it acce

[PHP-DEV] Benchmark Results for PHP Master 2015-08-25

2015-08-25 Thread lp_benchmark_robot
Results for project php-src-nightly, build date 2015-08-25 17:15:37+03:00 commit: 2455ab2a2b2c0cef14c1e3625a250c47b58c3475 revision_date: 2015-08-25 14:26:55+02: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] Notice on non existing array key (on a boolean)

2015-08-25 Thread Christoph Becker
On 25.08.2015 at 15:48, Sherif Ramadan wrote: > You're right. The notice is triggered by array_push behavior only, which > means that $x = true; echo $x['foo']; doesn't trigger the notice, which is > the same as your code above. Only write operations have historically > resulted in this notice. >

Re: [PHP-DEV] Notice on non existing array key (on a boolean)

2015-08-25 Thread Sherif Ramadan
Hey Nicolai, You're right. The notice is triggered by array_push behavior only, which means that $x = true; echo $x['foo']; doesn't trigger the notice, which is the same as your code above. Only write operations have historically resulted in this notice. I would agree that providing the notice wo

Re: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Pierre Joye
On Aug 25, 2015 7:19 PM, "Matt Wilmas" wrote: > > I didn't reply in last week's thread about the overflow checks in OpenSSL... > > But it is *definitely* fine to be optimistic and rely on compiler to do basic, basic stuff like this. No reason to make things more complicated just to think one is

[PHP-DEV] Notice on non existing array key (on a boolean)

2015-08-25 Thread Nicolai Scheer
Hi all, I'd expect the following code to throw a notice/warning: $x = true; $y = $x['foo']; It executes completely silently. $y is NULL afterwards, which is expected, since the right hand side of the assignment is undefined. If $x was an array (e.g. empty array), a E_NOTICE would be emitted. C

RE: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Anatol Belski
Hi Jakub, > -Original Message- > From: jakub@gmail.com [mailto:jakub@gmail.com] On Behalf Of Jakub > Zelenka > Sent: Tuesday, August 25, 2015 2:46 PM > To: Anatol Belski > Cc: Dmitry Stogov ; Rowan Collins > ; PHP Internals > Subject: Re: [PHP-DEV] Overflow checks and integral va

RE: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Anatol Belski
> -Original Message- > From: Matt Wilmas [mailto:php_li...@realplain.com] > Sent: Tuesday, August 25, 2015 2:19 PM > To: Anatol Belski ; 'Dmitry Stogov' ; > 'Xinchen Hui' ; 'Nikita Popov' ; > 'Pierre Joye' ; 'Bob Weinand' > ; 'Jakub Zelenka' > Cc: internals@lists.php.net > Subject: Re: [

Re: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Jakub Zelenka
Hi Anatol, On Tue, Aug 25, 2015 at 12:41 PM, Anatol Belski wrote: > Hi Dmitry, > > > -Original Message- > > From: Dmitry Stogov [mailto:dmi...@zend.com] > > Sent: Tuesday, August 25, 2015 9:29 AM > > To: Anatol Belski > > Cc: Rowan Collins ; PHP Internals > > > > Subject: Re: [PHP-DEV]

Re: [PHP-DEV] mysqli_get_cache_stats() has vanished

2015-08-25 Thread Christoph Becker
On 25.08.2015 at 14:03, Lior Kaplan wrote: > This might help: > > https://github.com/php/php-src/commit/f9ad56eab9e0010231643d51a0e0038f99f2f94b Thanks, Lior. Apparently the function was finally removed as of PHP 5.4.0. I'm going to remove the superfluous forward declaration, and update the ma

Re: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Matt Wilmas
Hi Anatol, Just a quick reply to couple parts... Have to go, and I don't care much either way about the stuff, just commenting before. :-) - Original Message - From: "Anatol Belski" Sent: Tuesday, August 25, 2015 Hi Matt, Thanks for the comments. -Original Message- From:

Re: [PHP-DEV] mysqli_get_cache_stats() has vanished

2015-08-25 Thread Lior Kaplan
This might help: https://github.com/php/php-src/commit/f9ad56eab9e0010231643d51a0e0038f99f2f94b Kaplan On Tue, Aug 25, 2015 at 2:25 PM, Christoph Becker wrote: > Hi! > > Does anybody know what happened to mysqli_get_cache_stats()? > Apparently, its implementation has vanished between two conse

RE: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Anatol Belski
Hi Dmitry, > -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Tuesday, August 25, 2015 9:29 AM > To: Anatol Belski > Cc: Rowan Collins ; PHP Internals > > Subject: Re: [PHP-DEV] Overflow checks and integral vars comparison > > Hi Anatol, > > I don't see any pro

RE: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Anatol Belski
Hi Matt, Thanks for the comments. > -Original Message- > From: Matt Wilmas [mailto:php_li...@realplain.com] > Sent: Tuesday, August 25, 2015 12:06 PM > To: Anatol Belski ; 'Dmitry Stogov' ; > 'Xinchen Hui' ; 'Nikita Popov' ; > 'Pierre Joye' ; 'Bob Weinand' > ; 'Jakub Zelenka' > Cc: inter

[PHP-DEV] mysqli_get_cache_stats() has vanished

2015-08-25 Thread Christoph Becker
Hi! Does anybody know what happened to mysqli_get_cache_stats()? Apparently, its implementation has vanished between two consecutive commits: ,

Re: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Matt Wilmas
Hi Anatol, Dmitry, all, - Original Message - From: "Anatol Belski" Sent: Friday, August 21, 2015 Hi, Resending this as missed internals at the start. I was lately rethinking some part of the 64-bit RFC, and also seeing now Jakub's work on catching overflows in ext/openssl and Matt Wil

Re: [PHP-DEV] Php Dockerfile for ppc64le

2015-08-25 Thread Kingsquare.nl - Robin Speekenbrink
Dear Meghali, There are various "official" docker images already available on the dockerhub: https://hub.docker.com/_/php/ You might want to post a reply there and might even contribute any changes or recommendations to the github repo for the dockerfiles used (https://github.com/docker-library/do

[PHP-DEV] Php Dockerfile for ppc64le

2015-08-25 Thread Meghali Dhoble
I have installed and tested PHP(5.6.8) on ppc64le architecture. I have also created a Dockerfile for this for ubuntutu 14.10 &15.04 as well and wish to contribute it to the community. Could anyone please help me in understanding on how to go about this? Thanks in advance! -Meghali

Re: [PHP-DEV] Overflow checks and integral vars comparison

2015-08-25 Thread Dmitry Stogov
Hi Anatol, I don't see any problem adding ZEND_LONG_INT_OVF and similar macros into 7.0. Thanks. Dmitry. On Mon, Aug 24, 2015 at 5:15 PM, Anatol Belski wrote: > Hi Rowan, > > > -Original Message- > > From: Rowan Collins [mailto:rowan.coll...@gmail.com] > > Sent: Monday, August 24, 2015