[#]PHP 8.4 is deprecating the usage of _ (underscore) as a class name. Anyone knows why?
The same name is available for functions, methods and constants, so, with named parameters, we can still write the beauty below.
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/no_more_class__.html
=> More informations about this toot | View the thread
When using dynamic code with #PHP, the code must provide a string for the method or property name. Although,
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/method_not_property_name_must_be_string.html
=> More informations about this toot | View the thread
Two things that surprised me today, with static.
First, it looks like a 'static' typed property, until I read the default value. It took me a while to figure out.
Secondly, static properties may be inherited, or be distinct from the parent: redefine it in the child, and that segregate them. 😮
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/static_properties.html
=> More informations about this toot | View the thread
The most common tools and services used in #PHP open source projects. VCS, CI, SCA, Unit Tests, builders, IDE...
2025 updated list.
https://www.exakat.io/en/common-services-with-php-application/
=> More informations about this toot | View the thread
[#]PHP trick question, for the Friday developer: where do you put the parenthesis in a new call:
[#]phptip #php trick
https://php-tips.readthedocs.io/en/latest/tips/new_and_parenthesis.html
=> More informations about this toot | View the thread
"Cannot call constructor" is a real #PHP error message. And there is also "Must call the parent constructor".
To call or not to call the constructor: definitely a question, and may be, an improvement for #PHP 8.5.
[#]phptip #phptrick
https://www.exakat.io/en/php-constructors-and-inheritance/
=> More informations about this toot | View the thread
I already knew that #PHP is
but TIL it is also a hairdresser in slovakia.
And you? What is your own special #PHP meaning?
https://www.exakat.io/en/what-does-php-mean/
=> More informations about this toot | View the thread
So, #PHP has fluent interfaces, but it also can do fluent functions: functions that can be chain called.
As usual, it works but it is a tad cumbersome.
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/fluent_function.html
=> More informations about this toot | View the thread
A #PHP global constant redefinition is a simple warning.
A #PHP class constant redefinition is a full Fatal Error.
I am so used to the Fatal error, that I expected the global constant to behave the same. Shouldn't they?
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/constant_redefinition.html
=> More informations about this toot | View the thread
Junior dev: I really really want to use {$a::class} inside a double-quoted #PHP string, but it gives a syntax error!
Me, an intellectual: Hold my beer.
https://php-tips.readthedocs.io/en/latest/tips/no-constant-in-string.html
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/no-constant-in-string.html
=> More informations about this toot | View the thread
There is a deprecation notice, that request to return an integer, not a boolean, for the custom sorting function of #PHP usort().
Well, it is not harmless, and should be taken seriously.
https://php-tips.readthedocs.io/en/latest/tips/return_int_not_bool.html
[#]phptip #phptrick
=> More informations about this toot | View the thread
Passing a literal by reference is a Fatal error,
while returning the same literal by reference is a notice.
[#]PHP : Why?
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/by_reference_errors.html
=> More informations about this toot | View the thread
How many ways do you know to call a #PHP method in the code ? There are obviously 2 very common ones, but there are a few others, that serve a niche usage.
All the ways to call a method in PHP
In total, I found 11 and missed 2.
[#]phptip #phptrick
https://www.exakat.io/en/call-a-method-in-php/
=> More informations about this toot | View the thread
How unique are #PHP anonymous objects?
They are all distinct, unless the code of definition is reused multiple and distinct times. Then, such objects are of the same class.
It's a bit weird to understand.
php-tips.readthedocs.io/en/latest/ti...
#phptip #phptrick
=> More informations about this toot | View the thread
[#]PHP Enumerations list all their values, by using ::case(), array_column and the property value.
So convenient!
https://php-tips.readthedocs.io/en/latest/tips/all_cases.html
[#]phptip #phptrick
=> More informations about this toot | View the thread
TIL that there are two ways to protect characters in a #PHP regex : preg_quote() and \Q .... \E.
It looks scary, but it might be very useful indeed.
https://php-tips.readthedocs.io/en/latest/tips/escaped_regex.html
[#]phptip #phptrick
=> More informations about this toot | View the thread
How can you get an 'undefined variable' on the same line where the variable is defined?
All is a matter of execution order. Probably not even #PHP related.
https://php-tips.readthedocs.io/en/latest/tips/undefined_variable.html
[#]phptip #phptrick
=> More informations about this toot | View the thread
[#]PHP 8.4 is released. Let the party begin!
New features, modernisation and clean up: the future is here.
Next stop: #PHP 8.5!
https://www.php.net/releases/8.4/en.php
=> More informations about this toot | View the thread
All #PHP curly braces, and one wrong. Can you spot it?
[#]phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/all_static_curly_syntaxes.html
=> More informations about this toot | View the thread
[#]PHP 8.4 countdown is on! This is in less than 4 sleeps!
Ready or not, just join us on Thursday, November 21rst to celebrate the release, in The Hague, @wodanbrothers!
News, features, elePHPant, fun and community!
https://www.meetup.com/den-haag-php/events/304263848/
=> More informations about this toot | View the thread
=> This profile with reblog | Go to dseguy@phpc.social account This content has been proxied by September (ba2dc).Proxy Information
text/gemini