[PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Michał Brzuchalski
Hi all, I would like to initiate discussion for Object typehint RFC https://wiki.php.net/rfc/object-typehint This feature is developed to provide missing functionality which is needed and quite easy to introduce. There are many people which I've talked about the benefits of this functionality.

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

2016-10-23 Thread Dan Ackroyd
Hi Craig, I voted yes, but have a request. When you update the manual, please can you explicitly what is allowed, rather than just saying what is not allowed as per the RFC text. cheers Dan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Marc Bennewitz
Am 23.10.2016 um 13:49 schrieb Niklas Keller: 2016-10-23 12:55 GMT+02:00 Marc Bennewitz >: Hi internals, On casting a non numeric value to a float in PHP the result will be float(0). In PHP-7.0 an exception was introduced that on

Re: [PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Marc Bennewitz
Am 23.10.2016 um 21:13 schrieb Marc Bennewitz: Am 23.10.2016 um 13:49 schrieb Niklas Keller: 2016-10-23 12:55 GMT+02:00 Marc Bennewitz >: Hi internals, On casting a non numeric value to a float in PHP the result will be float(0).

Re: [PHP-DEV] [RFC] OpenSSL BigNum support

2016-10-23 Thread Jakub Zelenka
On Tue, Oct 18, 2016 at 2:35 AM, Sara Golemon wrote: > As it says on the tin: Wrap the BN (BigNumber) library in OpenSSL. > > https://wiki.php.net/rfc/openssl.bignum > > I don't see any reason why we should expose BN API if it's not integrated with PKEY algorithms. This proposal

Re: [PHP-DEV] OpenSSL ext status including port to OpenSSL 1.1

2016-10-23 Thread Jakub Zelenka
Hey On Tue, Oct 11, 2016 at 6:01 PM, Davey Shafik wrote: > > 7.1 no longer supports LibreSSL due to the usage of some new openssl > changes, you can find the errors http://awel.domblogger. > net/7/php7/ssl_error.txt and a patch by the reporter here: >

Re: [PHP-DEV] [RFC] Convert numeric keys in object/array casts

2016-10-23 Thread Davey Shafik
This has been the case since 4.3 at the least: https://3v4l.org/bjZ4d On Sat, Oct 22, 2016 at 22:48 Yasuo Ohgaki wrote: > On Sun, Oct 23, 2016 at 4:59 AM, Yasuo Ohgaki wrote: > > Numeric key name must be string? > > > > $obj->{'0'} = 1; > > > > or could

[PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Marc Bennewitz
Hi internals, On casting a non numeric value to a float in PHP the result will be float(0). In PHP-7.0 an exception was introduced that on casting a string "/\s*NaN\s*/i" will result in float(NaN). https://3v4l.org/2Xakm Wouldn't it be more logical and expected to return NaN in all cases

Re: [PHP-DEV] strtod and NaN vs. zero

2016-10-23 Thread Niklas Keller
2016-10-23 12:55 GMT+02:00 Marc Bennewitz : > Hi internals, > > On casting a non numeric value to a float in PHP the result will be > float(0). > > In PHP-7.0 an exception was introduced that on casting a string > "/\s*NaN\s*/i" will result in float(NaN). > >

Re: [PHP-DEV] [RFC] Convert numeric keys in object/array casts

2016-10-23 Thread Stanislav Malyshev
Hi! > To try and fix a longstanding issue, and to actually bring some > attention to the fix, I've created a new RFC, which can be found here: > > https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts How common is this problem? It looks like an edge case of an edge case

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Stanislav Malyshev
Hi! > I would like to initiate discussion for Object typehint RFC > https://wiki.php.net/rfc/object-typehint I don't see why it would be important that the variable is an object but not important which kind of an object. There's very small number of things you can do with an object without

Re: [PHP-DEV] [RFC] OpenSSL BigNum support

2016-10-23 Thread Stanislav Malyshev
Hi! > What are the specific reasons for choosing OpenSSL Bignums over GMP, > outside of extension availability (which is totally a path I don't want us > to go down -- see also recent attempts to duplicate ext/mbstring into > ext/standard)? Are there any particular properties of the openssl >

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Levi Morrison
On Sun, Oct 23, 2016 at 1:39 AM, Michał Brzuchalski wrote: > Hi all, > > I would like to initiate discussion for Object typehint RFC > https://wiki.php.net/rfc/object-typehint > > This feature is developed to provide missing functionality which is needed > and quite easy

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Nikita Popov
On Sun, Oct 23, 2016 at 5:14 PM, Levi Morrison wrote: > On Sun, Oct 23, 2016 at 1:39 AM, Michał Brzuchalski > wrote: > > Hi all, > > > > I would like to initiate discussion for Object typehint RFC > > https://wiki.php.net/rfc/object-typehint > > > > This

Re: [PHP-DEV] [RFC] Convert numeric keys in object/array casts

2016-10-23 Thread Andrea Faulds
Hi Yasuo, Yasuo Ohgaki wrote: Nice RFC! It seems patch is made to convert int index to string index to allow numeric key, is it? Or vice-versa, yes. I guess it is the limitation and the reason why it's inaccessible. Yes. If you have an object whose HashTable has an integer key, say 123,

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Stephen Reay
I can see uses for it, although none of them are impossible without the object typehint - they currently do an is_object() check. In the same way that Iterable type hint allows you to safely do a foreach on an argument, object allows you to safely use property accessor syntax (i.e. ->). For me

Re: [PHP-DEV] [RFC] OpenSSL BigNum support

2016-10-23 Thread Sara Golemon
On Sun, Oct 23, 2016 at 5:06 PM, Stanislav Malyshev wrote: >> What are the specific reasons for choosing OpenSSL Bignums over GMP, >> outside of extension availability (which is totally a path I don't want us >> to go down -- see also recent attempts to duplicate ext/mbstring

[PHP-DEV] Security issue handling

2016-10-23 Thread Stanislav Malyshev
Hi! I'd like to discuss an issue about security bugs handling. We have a security repo which I and others check into bugs from time to time. The idea is for these to be reviewed by people having access there before we merge them, and then merge after the release. This, however, is not happening

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Stanislav Malyshev
Hi! > In the same way that Iterable type hint allows you to safely do a > foreach on an argument, object allows you to safely use property > accessor syntax (i.e. ->). For me it would be most useful in lower > level utility classes. Not sure I get this point. How you can safely use -> if you

Re: [PHP-DEV] [RFC] OpenSSL BigNum support

2016-10-23 Thread Stanislav Malyshev
Hi! > Is the feedback then that we should expose /more/ of the OpenSSL API? Well, not exactly more of the API I think but ways to link bignums to others OpenSSL functions. Think about it this way: what people frequently use bignums for? Doing some kind of crypto-like stuff. But if you want to do

[PHP-DEV] bug classification discussion

2016-10-23 Thread Stanislav Malyshev
Hi! We have had a bunch of bugs recently which are essentially one and the same issue: PHP 5.6 allows only int-sized strings, but many functions don't check the size of the string they produce. This can lead to int overflows inside php and also can break other libraries that also assume string

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Michał Brzuchalski
24.10.2016 07:05 "Stanislav Malyshev" napisał(a): > > Hi! > > > In the same way that Iterable type hint allows you to safely do a > > foreach on an argument, object allows you to safely use property > > accessor syntax (i.e. ->). For me it would be most useful in lower > >

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Stephen Reay
No, I don’t expect all objects to have the same properties. So, today I learned that `$foo = 1; isset($foo->bar);` doesn’t throw an error about a non-object. However, property_exists *does* throw errors in that situation, as does get_object_vars() - two situations where you *can* pass any

Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint

2016-10-23 Thread Stanislav Malyshev
Hi! > Like I said, the functionality is possible without it. But what > functionality was impossible without int/float/string type hints? I don't think it's a good argument "if we added something to the language, from this point on anything can be added because why not?" Yes, you can write code