Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Chuck Adams
On Mon, Aug 26, 2024 at 5:36 AM, Jakob Givoni <[ja...@givoni.dk](mailto:On Mon, Aug 26, 2024 at 5:36 AM, Jakob Givoni < wrote > "default" should not evaluate to a value before sending it as an argument to > the function or method. I have no dog in this fight, but I agree with the above. Plus, h

Re: [PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV)

2024-07-04 Thread Chuck Adams
> On Jul 4, 2024, at 12:02 PM, Mike Schinkel wrote: > > Your definitions are language-specific. For example, in Go the definitions > for those terms are the opposite of how you defined them. > > The point being that PHP is free to choose how they are defined with respect > to PHP. > > To w

Re: [PHP-DEV] [PHP-Dev] Versioned Packagers (Iteration IV)

2024-07-04 Thread Chuck Adams
> On Jul 3, 2024, at 6:16 PM, Michael Morris wrote: > > Hello all. Hitting reset again as the primary problem at hand has become > clear. Let's recap it. > > Autoloading is great for loading packages, but it can't load different > versions of the same package at the same time. Why would y

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4

2024-06-27 Thread Chuck Adams
> On Jun 27, 2024, at 11:26 AM, Tim Düsterhus wrote: > > Hi > > On 6/27/24 19:09, Chuck Adams wrote: >> Personally I say let strtok be and just admit in the documentation that it’s >> weird because C. > > strtok() is not weird because C. It does not rely on

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4

2024-06-27 Thread Chuck Adams
> On Jun 27, 2024, at 2:22 AM, Stephen Reay wrote: > > I do appreciate that strtok has a kind of bizarre signature/use pattern and > potential for confusion due to how subsequent calls work, but to me that > sounds like a better result for uses that need the repeated call > functionality, would

Re: [PHP-DEV] [RFC] Static class

2024-06-26 Thread Chuck Adams
> On Jun 26, 2024, at 5:49 PM, Derick Rethans wrote: > > There has been some work done on function autoloading too: > https://wiki.php.net/rfc/core-autoloading Fantastic! I still want modules and/or companion objects of course... I wonder whether the autoloading machinery could be bent to

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-26 Thread Chuck Adams
> On Jun 26, 2024, at 1:50 PM, Morgan wrote: > So the issue has nothing to do with this hypothetical infinity of > unobservable nulls, and comes entirely down to the fact that with this > pattern a variable may pass > a) because it does not have a key named 'foo', or > b) because it has a key na

Re: [PHP-DEV] [RFC] Static class

2024-06-25 Thread Chuck Adams
> On Jun 25, 2024, at 9:17 AM, Derick Rethans wrote: > > Having read this thread, and the previous one from half a year ago, I > will do so too. In short, we shouldn't be encouraging static classes as > a bag of static functions, that ought to be just namespaced functions. Which brings us back to

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-24 Thread Chuck Adams
> On Jun 24, 2024, at 1:53 PM, Robert Landers wrote: > > $arr = ['a' => 'a string']; > $arr is ['a' => string, ?'b' => $value, ...]; > > This syntax implies that a non-existent key is a special case, and if > it passes as-is, it will be. If there is a binding and the key is > missing, what happens

Re: [PHP-DEV] [Early Feedback] Pattern matching

2024-06-24 Thread Chuck Adams
> On Jun 24, 2024, at 3:31 AM, Robert Landers wrote: > > > There's no need to use `?` to check for existence on a key, so this: > > $arr is ['a' => string, ?'b' => string, ...]; > > should be this: > > $arr is ['a' => string, 'b' => ?string, ...]; > > because $arr['non-existent-key'] is NU

Re: [PHP-DEV] Analysis of property visibility, immutability, and cloning proposals

2020-12-30 Thread Chuck Adams
On Wed, Dec 30, 2020 at 12:27 PM Larry Garfield wrote: > > If you clone the object, you don't duplicate 15+1 zvals. You duplicate just > the one zval for the object itself, which reuses the existing 15 internal > property entries. If in the new object you then update just the third one, > PHP

Re: [PHP-DEV] Suggestion: Inconsistency: Allow array spread operator to work on string keys

2020-12-02 Thread Chuck Adams
On Wed, Dec 2, 2020 at 10:46 AM G. P. B. wrote: > The reason why this has been deferred is because of which semantics should > be used for duplicate string keys. > > Do we use the addition between two arrays semantics or the array_merge() > semantics? See: https://3v4l.org/7QbWv array_merge is th

Re: [PHP-DEV] Proposal: php.ini environment variable fallback value

2020-07-25 Thread Chuck Adams
On Sat, Jul 25, 2020 at 9:30 AM Chuck Adams wrote: > > Not a fan of special syntax for environment variables regardless of > the syntax. I think `$_ENV['foo'] ?? 'bar'` is fine as-is. Not so > much the superglobal, but there's also getenv(). I feel fairly

Re: [PHP-DEV] Proposal: php.ini environment variable fallback value

2020-07-25 Thread Chuck Adams
On Fri, Jul 24, 2020 at 2:54 PM Derek Bonner wrote: > * memory_limit = ${PHP_MEMORY_LIMIT:-"default value"} > * memory_limit = ${PHP_MEMORY_LIMIT::"default value"} > * memory_limit = ${PHP_MEMORY_LIMIT:="default value"} > * memory_limit = ${PHP_MEMORY_LIMIT=="default value"} Not a fan of special

Re: [PHP-DEV] Ternary associativity

2020-07-25 Thread Chuck Adams
On Fri, Jul 24, 2020 at 1:32 PM Rowan Tommins wrote: > If anything, I would argue for making both of these into errors, if > that's possible. I think the biggest risk with this kind of change is > not existing code relying on the old behaviour, it is code relying on > the *new* behaviour which is

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Chuck Adams
On Sat, Jul 11, 2020 at 8:56 AM Rowan Tommins wrote: > (and, funnily enough, PHP 4 did for objects). The funny thing about it for me is that this behavior caused me to throw such a fit when I discovered it -- more to say burned by it -- that I swore off PHP forever at the time. Now I actually w

Re: [PHP-DEV] Possible RFC: UniqueInterface that throws exception at refcount > 1

2020-07-11 Thread Chuck Adams
On Sat, Jul 11, 2020 at 8:06 AM Olle Härstedt wrote: > > Dear internals, > > I'd like to discuss the concept of ownership in PHP, from the point of > view of a new interface UniqueInterface (or SplUniqueInterface or > something), which will throw a UniqueException if refcount > 1. > > Use-case: Mu

Re: [PHP-DEV] [VOTE] Named arguments

2020-07-10 Thread Chuck Adams
> Then the question becomes, do we rename parameters a lot? I doubt it's a > large problem, and even then the variadics support makes it very easy to > handle in a backwards compatible way. In addition libraries are always open > to declare they don't consider named parameters as part of their API.

Re: [PHP-DEV] About the use of the terms master/slave and blacklist, proposal to replace.

2020-06-16 Thread Chuck Adams
I might suggest that we at least confine any renaming to things that are user-visible and not worry about the source code. Except they're going to need aliases for all time, that's just a fact. Although I'm all about addressing the injustices of the past and present, I think it would be a lot mor

Re: [PHP-DEV] About the use of the terms master/slave and blacklist, proposal to replace.

2020-06-15 Thread Chuck Adams
Oh man, not this again, not here. Nothing intelligent ever comes out of this. Looks like most instances in the PHP source refer to mysql constants, which means the ball would be in mysql's court. Reality is you'd still need the aliases that contain the offending word. The other is in ext/standa

Re: [PHP-DEV] Revisiting proposal for addition of `get_class_constants()`

2020-06-12 Thread Chuck Adams
> 1. It aligns with the addition of the functions referenced in the original post (`str_[contains|starts_with|ends_with]()`), and one their stated reasons of simplifying the API for userland developers. Two reactions to this: One, reflection isn't a facility for novices, so there's no need to cate

Re: [PHP-DEV][RFC] Rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON

2020-06-10 Thread Chuck Adams
(Trying again without a plussed address, which is too much hassle for the ML. Sorry for dups.) Honestly, I'd rather PHP didn't barf raw lex tokens to the end user for its output. But until then, renaming it seems wise. Didn't someone come out and claim that the current token is misspelled Hebre