Re: [PHP-DEV] Add support for ::class to constant()

2021-03-13 Thread Rowan Tommins
On 9 March 2021 22:15:49 GMT, "Kévin Dunglas" wrote: >Hi folks, > >Currently, it's not possible to use the ::class special constant with >the >constant() function. This doesn't work: > >var_dump( > constant('\DateTime::class') >); While this looks logical at first glance, I'm not sure this can

[PHP-DEV] Built-in decorator attribute?

2021-03-13 Thread David Gebler
With the introduction of attributes in PHP 8, this new behaviour is still quite sparsely documented. Some of the articles I've seen out there, though, liken PHP's attributes to similar constructs in other languages including decorators in Python. Attributes are not the same thing as (Python's conc

[PHP-DEV] [RFC] debug_backtrace_depth(int $limit=0): int

2021-03-13 Thread tyson andre
Hi internals, I've created a new RFC https://wiki.php.net/rfc/debug_backtrace_depth to return the depth of the current stack trace. Inspecting the current stack trace depth is occasionally useful for 1. Manually debugging with temporary debug statements 2. Checking for potential infinite recursi

[PHP-DEV] Re: Built-in decorator attribute?

2021-03-13 Thread David Gebler
Oops, didn't tag the subject. On Sat, Mar 13, 2021 at 4:51 PM David Gebler wrote: > With the introduction of attributes in PHP 8, this new behaviour is still > quite sparsely documented. Some of the articles I've seen out there, > though, liken PHP's attributes to similar constructs in other lan

[PHP-DEV] RFC: Add `println(string $data = ''): int`

2021-03-13 Thread tyson andre
Hi internals, I've created a new RFC https://wiki.php.net/rfc/println This proposes adding a global function to PHP to print a string followed by a unix newline (`\n`). Printing a string followed by a newline to stdout is a commonly performed operation in many applications and programming langu

Re: [PHP-DEV] RFC: Add `println(string $data = ''): int`

2021-03-13 Thread Kamil Tekiela
Hi Tyson, I like this proposal, but why is the main argument optional? Wouldn't it make sense to always require a string as an argument? Regards, Kamil

Re: [PHP-DEV] RFC: Add `println(string $data = ''): int`

2021-03-13 Thread tyson andre
> Hi Tyson, > > I like this proposal, but why is the main argument optional? Wouldn't it > make sense to always require a string as an argument? > > Regards, > Kamil I initially considered making it required, but then I felt like there wasn't a compelling reason to force end users to write `pri

Re: [PHP-DEV] Storing the lcname of symbols

2021-03-13 Thread tyson andre
Hi Levi Morrison, > > Hello! > > > > Most of PHP's symbols are case insensitive. This means extensions that > > need to do things with function and method names end up lowercasing > > and hashing the lowercased names, often having to do more memory > > allocations too. Since case insensitive symbo

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-13 Thread Peter Stalman
Hi David, This sounds a lot like Asect Oriented Programming. Have you looked into that? PHP framework: https://github.com/goaop/framework PECL extension: https://aop-php.github.io/ Thanks, Peter On Sat., Mar. 13, 2021, 08:51 David Gebler, wrote: > With the introduction of attributes in PH

Re: [PHP-DEV] Built-in decorator attribute?

2021-03-13 Thread David Gebler
Decorators are a way of bringing aspect oriented programming into PHP core, yes, among other uses. Go AOP is a fairly bulky framework which could be easily replaced by a Decorator attribute for the purposes of cross-cutting changes to function behaviour. Regards, David On Sat, Mar 13, 2021 at 10

Re: [PHP-DEV] support for BLAKE3 hash?

2021-03-13 Thread Anatol Belski
Hi, thanks for keeping in sync with the world events on hashing, especially crypto hashing. I saw happenings from the mentioned PR, but couldn't really follow closely. Could you please tell, what the current impediments on this work are? Please see to rebase the patch to the latest master to ease