[PHP-DEV] ZEND_ENGINE_4 define?

2020-08-09 Thread Philip Hofstetter
Hello, I'm currently looking into porting some extensions (both internal and public) to PHP 8 while still keeping support for PHP 7 (for the public ones) and PHP 5.6 (don't ask :-(). In many cases, I've been using the ZEND_ENGINE_3 define to handle the PHP 5/7 difference. Now, the Zend Engine

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Marco Pivetta
Hey Manuel, On Sun, Aug 9, 2020, 11:02 Manuel Canga wrote: > Hi Internals, > > I'd like to open up a discussion around the implementation of a new > functionality: 'import of variables'. > > This functionality would allow to create a new 'use vars' keyword in > order to can use( or cannot

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Manuel Canga
-- Manuel Canga En dom, 09 ago 2020 23:41:12 +0200 Rowan Tommins escribió > On 9 August 2020 22:35:11 BST, Manuel Canga wrote: > > Hi Manuel, > > I think there's a misunderstanding. My comments weren't really about how to > implement your proposal, they were about the

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Manuel Canga
Hi, David. Thanks En dom, 09 ago 2020 16:58:41 +0200 David Rodrigues escribió > I suggests to make something like Node does: import "file.php" ($a, $b) so > $a and $b must be extracted from file.php context. All other variables > should be ignored. > Or, to avoid create more

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Manuel Canga
Hi, Josh. Thanks En dom, 09 ago 2020 21:36:30 +0200 Josh Bruce escribió > Have not tested - just catching up on emails. > > To verify: A property defined with a default value of the global does not > already do this? In functions/methods. In some files can "inherit" gobal

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Manuel Canga
Hi, Tyson, Thanks. En dom, 09 ago 2020 16:41:44 +0200 tyson andre escribió > Hi Internals, > > To be clear: The variables in the top-level scope depend on what has > require()d/include()d a file. > The top-level scope starts off as being global, but if a file is required

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Rowan Tommins
On 9 August 2020 22:35:11 BST, Manuel Canga wrote: >I don't know about internal C PHP, but could it be implemented as... Hi Manuel, I think there's a misunderstanding. My comments weren't really about how to implement your proposal, they were about the features the language already has, which

Re: [PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable

2020-08-09 Thread tyson andre
Hi Josh, I'd recommend looking at https://github.com/php/php-src/pull/5156 (linked to in your RFC's reference) when implementing this PR. Additionally, I didn't see if this was brought up - PHP already has a class which is falsifiable - SimpleXMLElement. You can see the source of

Re: [PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable

2020-08-09 Thread Josh Bruce
Trying not to drown the list while some RFCs are getting worked out and preparing for 8.0. Quick update: 1. Walking through Nikita’s instructions - writing about it here: https://joshbruce.dev/essays/software-development/php-falsifiable-objects

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Josh Bruce
Have not tested - just catching up on emails. To verify: A property defined with a default value of the global does not already do this? Developer need: I rarely access global variables directly - usually going through a lib or framework. When I do I would probably wrap the access in a trait

[PHP-DEV] Allow dropping (true) from match expression conditions in 8.1

2020-08-09 Thread tyson andre
Hi internals, https://wiki.php.net/rfc/match_expression_v2#allow_dropping_true mentioned this in the future scope. ``` $result = match { ... }; // Equivalent to $result = match (true) { ... }; ``` https://externals.io/message/110243#110292 summarizes the current status > 80% were in favor of

Re: [PHP-DEV] Null-safe property access in interpolated strings

2020-08-09 Thread Deleu
I like and make use of interpolation, but I can't think of a use case for this. Is there any valid use case that would benefit from this fix regardless of personal preference? In other words, where would one use string interpolation with an empty string being a valid case? On Sun, Aug 9, 2020,

[PHP-DEV] Re: Improving the usability of PHP's interactive shell? (completions, displaying expression results, custom syntax)

2020-08-09 Thread tyson andre
Hi internals, > - Add a hook to `readline` such as > `readline_set_php_result_handler_callback(function(mixed $result, string > $snippet){...})` >   that can be used to create a user-defined function to print/process the > result of expressions. >  (Create a clone of `zend_eval_stringl` to

Re: [PHP-DEV] Null-safe property access in interpolated strings

2020-08-09 Thread Jordi Boggiano
On 09/08/2020 00:17, Sara Golemon wrote: Do we expect this to work? $foo = new stdClass; $foo->bar = "Hello"; echo "$foo?->bar world\n"; Because at the moment it doesn't: https://3v4l.org/nLv3l -Sara Can't say I'm big on interpolation but I'd definitely expect this to work because why not?

Re: [PHP-DEV] Null-safe property access in interpolated strings

2020-08-09 Thread Ilija Tovilo
Hi internals > Do we expect this to work? > > $foo = new stdClass; > $foo->bar = "Hello"; > echo "$foo?->bar world\n"; > > Because at the moment it doesn't: https://3v4l.org/nLv3l The patch can be found here: https://github.com/php/php-src/pull/5966 It adds ~5 lines to the lexer. As mentioned,

Re: [PHP-DEV] Re: [RFC][Proposal] Renamed parameters

2020-08-09 Thread Rowan Tommins
On 09/08/2020 18:14, Chris Riley wrote: Hi all, RFC link: https://wiki.php.net/rfc/renamed_parameters I have spent the weekend working on a final revision for this RFC to address several of the points brought up. My opinion on this RFC remains unchanged: - It would have been a reasonable

Re: [PHP-DEV] Re: [RFC][Proposal] Renamed parameters

2020-08-09 Thread Benas IML
After sending out the email, I found out that I replied to the wrong email, nevermind... Sorry about that! Best regards, Benas On Sun, Aug 9, 2020, 8:25 PM Benas IML wrote: > Hey Chris, > > thanks for the RFC but I'd like to remind you that we are already past the > feature freeze. Moreover,

Re: [PHP-DEV] Re: [RFC][Proposal] Renamed parameters

2020-08-09 Thread Benas IML
Hey Chris, thanks for the RFC but I'd like to remind you that we are already past the feature freeze. Moreover, it seems that you don't have an actual implementation as well. Best regards, Benas On Sun, Aug 9, 2020, 8:15 PM Chris Riley wrote: > Hi all, > > RFC link:

[PHP-DEV] Re: [RFC][Proposal] Renamed parameters

2020-08-09 Thread Chris Riley
Hi all, RFC link: https://wiki.php.net/rfc/renamed_parameters I have spent the weekend working on a final revision for this RFC to address several of the points brought up. Specifically: - Cut down the scope of the RFC to only focus on delivering an opt in to named parameters, with the renaming

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-09 Thread Kamil ES
Hi everyone. I’m not a PHP internal, just a modest PHP developer. But I felt a desire to share my observation on “@@”. Some symbols looks very okay when doubled. For example, we use “//” for comments and “||” for logical alternative. They are okay, because they contains only two parallel lines.

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread David Rodrigues
I suggests to make something like Node does: import "file.php" ($a, $b) so $a and $b must be extracted from file.php context. All other variables should be ignored. Or, to avoid create more complexity and possible new keywords to import syntax, maybe create a new function: importx(string $file,

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread tyson andre
Hi Internals, > This functionality would allow to create a new  'use vars' keyword in order > to can use( or cannot use )  global variables in local scope( of current file > ). To be clear: The variables in the top-level scope depend on what has require()d/include()d a file. The top-level

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-09 Thread Andreas Leathley
Hello Derick & Internals, I am a daily user of PHP and read through all the recent discussions about the attribute syntax, and thought I could add some slightly different viewpoints from an "end-user" who uses the current annotations a lot. This is my first time posting, so I am hoping I am doing

Re: [PHP-DEV] Null-safe property access in interpolated strings

2020-08-09 Thread Yousuf Tafhim
What are the good uses cases for this to work? On Sun, Aug 9, 2020 at 8:48 AM Marco Pivetta wrote: > On Sun, Aug 9, 2020, 00:17 Sara Golemon wrote: > > > Do we expect this to work? > > > > $foo = new stdClass; > > $foo->bar = "Hello"; > > echo "$foo?->bar world\n"; > > > > Because at the

Re: [PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Rowan Tommins
On 09/08/2020 10:01, Manuel Canga wrote: Hi Internals, I'd like to open up a discussion around the implementation of a new functionality: 'import of variables'. This functionality would allow to create a new 'use vars' keyword in order to can use( or cannot use ) global variables in local

[PHP-DEV] [RFC] Import of variables

2020-08-09 Thread Manuel Canga
Hi Internals, I'd like to open up a discussion around the implementation of a new functionality: 'import of variables'. This functionality would allow to create a new 'use vars' keyword in order to can use( or cannot use ) global variables in local scope( of current file ). I think the best