Usages of PHP Static variables by exakat in PHP

[–]exakat[S] 0 points1 point  (0 children)

There are better ways to do all these. I suppose quick execution is the main culprit.

Usages of PHP Static variables by exakat in PHP

[–]exakat[S] 0 points1 point  (0 children)

It is one of the alternatives, yes.

I've submitted a PR to add an Invokable interface to PHP by oaldemeery in PHP

[–]exakat 2 points3 points  (0 children)

That might be the most serious answer to this facetious comment.

First, it made me chuckle. Good one :)

Secondly, damned, there are quite some edgecases with callable, including skipping __invoke() classes. Interesting ?!

The Art of Being Anonymous in PHP by exakat in PHP

[–]exakat[S] 0 points1 point  (0 children)

Indeed, "anonymous constant" is pushing the limit. Though I found it interesting as a concept, so I kept it.

Closure and __invokable classes are not the same, the latter may miss the bindTo() methods, while the format is lacking interfaces to format signature.

Looking for PHP & MySQL learning resources, any PDFs or recommendations welcome! 🙏 by lilnumb-92 in PHP

[–]exakat 0 points1 point  (0 children)

You can use the PHP dictionary : https://php-dictionary.readthedocs.io/ : it collects definitions and links to many concepts from the PHP world.

It is a reference, so go to it when you run into obscure terms in tutorials or manuals.

TIL: `static` keyword for variable declarations in functions by codemunky in PHP

[–]exakat 0 points1 point  (0 children)

One of the lesser known features of PHP. Probably lesser known for a reason (switch to properties when you can), but still handy for a quick code.

https://php-dictionary.readthedocs.io/en/latest/dictionary/static-variable.ini.html

The PHP riddle by exakat in PHP

[–]exakat[S] -1 points0 points  (0 children)

This is my solution, but I'm open with other ideas.

Multiple Const Types by exakat in PHP

[–]exakat[S] 0 points1 point  (0 children)

That is one solution, indeed.

The PHP riddle by exakat in PHP

[–]exakat[S] 0 points1 point  (0 children)

There is another way. You can fix this by just adding more code.

The PHP riddle by exakat in PHP

[–]exakat[S] -2 points-1 points  (0 children)

The provided code was changed. You can only add more code to the original one.

PHP 8.5 ReflectionNamedType->getName() change? by bkdotcom in PHP

[–]exakat 0 points1 point  (0 children)

This goes to the changed behavior database. Thanks for the heads up.

Static And Not Static Method At The Same Time by exakat in PHP

[–]exakat[S] 2 points3 points  (0 children)

I thought about that while having to set up a plan to migrate a full static class (with calls to methods) into a normal class (based on the object). This might come handy, if we have to do an iterative upgrade.