Re: [PHP-DEV] Initializing constants once, with code?

2020-01-08 Thread Mike Schinkel
> On Jan 8, 2020, at 4:25 PM, Mike Schinkel wrote: > >> On Jan 8, 2020, at 11:10 AM, Robert Hickman wrote: >> >> My suggestion was not a preprocessor, but what others have said >> already, a 'shim' that goes between the parser/lexer and bytecode >> generation which allows user code to inspect a

Re: [PHP-DEV] Initializing constants once, with code?

2020-01-08 Thread Mike Schinkel
> On Jan 8, 2020, at 11:10 AM, Robert Hickman wrote: > > My suggestion was not a preprocessor, but what others have said > already, a 'shim' that goes between the parser/lexer and bytecode > generation which allows user code to inspect and modify the AST. This > idea is not unusual and Python for

Re: [PHP-DEV] [RFC] Static return type

2020-01-08 Thread Ben Ramsey
> On Jan 8, 2020, at 05:42, Nikita Popov wrote: > > Hi internals, > > I would like to propose the following RFC, which allows using "static" as a > return type: > > https://wiki.php.net/rfc/static_return_type > > While I'm personally not a fan of late static binding, we do support it and > peo

Re: [PHP-DEV] Initializing constants once, with code?

2020-01-08 Thread Robert Hickman
> After posting my objection to pre-processing I remembered there was another > reason I object to pre-processors that is even more significant than lack of > composibility. And my objection extends to all the transpiring being done > with Javascript and CSS too, although I put up with those be

Re: [PHP-DEV] [RFC] Static return type

2020-01-08 Thread Benjamin Morel
> > I would like to propose the following RFC, which allows using "static" as a > return type: > https://wiki.php.net/rfc/static_return_type Big +1 from me as well. I actually asked why this wasn't supported back in 2015: static return type in PHP 7 interfaces

RE: [PHP-DEV] zend_call_method with arguments passed by reference

2020-01-08 Thread mdolezal.noctuint.cz via internals
Thank you for your answer Nikita. Can you please give me more details what you mean? I can try that approach. zend_call_method copies the args to params array which is assigned to zend_fcall_info fci. I can pass there for example "test" zval string. Then the mentioned lower level zend_call_functi

Re: [PHP-DEV] zend_call_method with arguments passed by reference

2020-01-08 Thread Nikita Popov
On Wed, Jan 8, 2020 at 3:59 PM mdolezal.noctuint.cz via internals < internals@lists.php.net> wrote: > Hello, > > I hope this is the appropriate mailing list, please redirect me to better > please if required. > > > > I am currently rewriting our PHP extension from PHP5 to PHP7. > > To call PHP met

[PHP-DEV] zend_call_method with arguments passed by reference

2020-01-08 Thread mdolezal.noctuint.cz via internals
Hello, I hope this is the appropriate mailing list, please redirect me to better please if required. I am currently rewriting our PHP extension from PHP5 to PHP7. To call PHP methods from our C/C++ code we use slightly modified zend_call_method from Zend/zend_interfaces.c (to use more argumen

[PHP-DEV] Bump required libcurl version to 7.17.1

2020-01-08 Thread Christoph M. Becker
Hi all, quite a while ago I've submitted , but received no feedback on that so far, so I'm writing this mail. The pull request is about bumping the required libcurl version for ext/curl to 7.17.1, which has been released twelve years ago. The main reason

Re: [PHP-DEV] [RFC] Static return type

2020-01-08 Thread Paul M. Jones
> On Jan 8, 2020, at 05:42, Nikita Popov wrote: > > Hi internals, > > I would like to propose the following RFC, which allows using "static" as a > return type: > > https://wiki.php.net/rfc/static_return_type Very happy to see this. -- Paul M. Jones pmjo...@pmjones.io http://paul-m-jones

Re: [PHP-DEV] Adding TypeError and ValueError to count() function

2020-01-08 Thread Björn Larsson
Den 2020-01-07 kl. 21:57, skrev George Peter Banyard: Greetings internals, I would like your input on adding TypeError and ValueError exceptions to the count() function in respect to the Consistent type errors for internal functions RFC [1], the initial PR [2] was denied as null was not accepted

[PHP-DEV] Re: [RFC] Static return type

2020-01-08 Thread Mark Randall
On 08/01/2020 11:42, Nikita Popov wrote: Hi internals, I would like to propose the following RFC, which allows using "static" as a return type: https://wiki.php.net/rfc/static_return_type So many "@return $this" docblocks are going to be deleted as a result of this when PHP8 lands. +1 from

Re: [PHP-DEV] [RFC] Static return type

2020-01-08 Thread Rowan Tommins
On Wed, 8 Jan 2020 at 11:42, Nikita Popov wrote: > I would like to propose the following RFC, which allows using "static" as a > return type: > > https://wiki.php.net/rfc/static_return_type > > While I'm personally not a fan of late static binding, we do support it and > people do use it quite he

[PHP-DEV] [RFC] Static return type

2020-01-08 Thread Nikita Popov
Hi internals, I would like to propose the following RFC, which allows using "static" as a return type: https://wiki.php.net/rfc/static_return_type While I'm personally not a fan of late static binding, we do support it and people do use it quite heavily, so I think we should also support it in r

Re: [PHP-DEV] Initializing constants once, with code?

2020-01-08 Thread Rowan Tommins
On Tue, 7 Jan 2020 at 22:19, Mike Schinkel wrote: > I think you are taking one of my use-cases and over-focusing on it rather > than accepting it as just one of many applicable use-cases. > Yes, I dived quite deep into that one example, mostly because I was trying to understand why you picked i