Re: [PHP-DEV] Passing HashTable data from php.ini to an extension method: corrupted values

2020-09-22 Thread Alexander Mashin
18.09.2020 14:36, Nikita Popov wrote: > ZVAL_STRINGL allocates a per-request string. You'll want to use > ZVAL_STR(&val_z, zend_string_init(val, val_len, 1)); or so. Thank you very much, it helped. Might I ask a further question? I want to make a PHP extension call certain functions from extern

Re: [PHP-DEV] Attributes and strict types

2020-09-22 Thread Benjamin Morel
I'd expect it to obey the strict_types declaration of UseOfMyAttribute.php, too. I see it as being where the attribute's constructor is "called", even though the actual object instantiation happens somewhere else. — Benjamin On Tue, 22 Sep 2020 at 16:11, Larry Garfield wrote: > On Tue, Sep 22,

Re: [PHP-DEV] Attributes on property groups

2020-09-22 Thread tyson andre
Hi Nikita, > Hi internals, > > Currently, placing an attribute on property (or constant) groups is not > allowed: > > class Foo { >     #[NonNegative] >     public int $x, $y, $z; > } > // Fatal error: Cannot apply attributes to a group of properties > > This is a case that was not explicitly m

Re: [PHP-DEV] Namespace-private class properties

2020-09-22 Thread Olle Härstedt
2020-09-22 14:51 GMT, guilhermebla...@gmail.com : > This should answer your question: > https://github.com/php/php-src/pull/947#issuecomment-224912697 > Yes, indeed. "The reason comes due to how namespaces are implemented in the language, where they only exist at compile time." Pity. > On Tue,

Re: [PHP-DEV] Namespace-private class properties

2020-09-22 Thread guilhermebla...@gmail.com
This should answer your question: https://github.com/php/php-src/pull/947#issuecomment-224912697 On Tue, Sep 22, 2020 at 7:38 AM Olle Härstedt wrote: > > 2020-09-21 21:50 GMT, Rowan Tommins : > > On 21/09/2020 17:13, Michael Morris wrote: > >> Next thing to consider - we have the problem of havin

Re: [PHP-DEV] Attributes on property groups

2020-09-22 Thread Larry Garfield
On Tue, Sep 22, 2020, at 7:51 AM, Nikita Popov wrote: > Hi internals, > > Currently, placing an attribute on property (or constant) groups is not > allowed: > > class Foo { > #[NonNegative] > public int $x, $y, $z; > } > // Fatal error: Cannot apply attributes to a group of properties >

Re: [PHP-DEV] Attributes and strict types

2020-09-22 Thread Larry Garfield
On Tue, Sep 22, 2020, at 7:58 AM, Nikita Popov wrote: > Hi internals, > > I would like to clarify how attributes are supposed to interact with > strict_types. Consider the following code, split up into three files to > make it clear that each one could have their own strict_types mode: > > MyAttr

Re: [PHP-DEV] Attributes on property groups

2020-09-22 Thread Benas IML
And why would we want to do that? On Tue, Sep 22, 2020, 4:04 PM Marco Pivetta wrote: > Probably easier/simpler to deprecate (then remove) property declaration > groups, no? > > On Tue, Sep 22, 2020, 14:51 Nikita Popov wrote: > > > Hi internals, > > > > Currently, placing an attribute on propert

Re: [PHP-DEV] Attributes and strict types

2020-09-22 Thread Brent Roose
Hi Nikita From a userland point of view, I'd indeed expect this example to use strict_types, because it's declared in UseOfMyAttribute.php. Is this something that can be changed still? Kind regards Brent > On 22 Sep 2020, at 14:58, Nikita Popov wrote: > > Hi internals, > > I would like to c

Re: [PHP-DEV] Attributes on property groups

2020-09-22 Thread Marco Pivetta
Probably easier/simpler to deprecate (then remove) property declaration groups, no? On Tue, Sep 22, 2020, 14:51 Nikita Popov wrote: > Hi internals, > > Currently, placing an attribute on property (or constant) groups is not > allowed: > > class Foo { > #[NonNegative] > public int $x, $y,

[PHP-DEV] Attributes and strict types

2020-09-22 Thread Nikita Popov
Hi internals, I would like to clarify how attributes are supposed to interact with strict_types. Consider the following code, split up into three files to make it clear that each one could have their own strict_types mode: MyAttribute.php getAttributes()[0]->newInstance()); Currently, what happe

[PHP-DEV] Attributes on property groups

2020-09-22 Thread Nikita Popov
Hi internals, Currently, placing an attribute on property (or constant) groups is not allowed: class Foo { #[NonNegative] public int $x, $y, $z; } // Fatal error: Cannot apply attributes to a group of properties This is a case that was not explicitly mentioned in the RFC and we decided t

Re: [PHP-DEV] Namespace-private class properties

2020-09-22 Thread Olle Härstedt
2020-09-21 21:50 GMT, Rowan Tommins : > On 21/09/2020 17:13, Michael Morris wrote: >> Next thing to consider - we have the problem of having already used the >> protected keyword in PHP, and honestly I prefer PHP's interpretation of >> the >> word. > > > I think it's actually Java that's the outlie