Does PHP7.1 support operator overloading? Currently, it is only a proposal.
News source: http://www.phpclasses.org/blog/post/350-Operator-Overloading-in-PHP-71--Lately-in-PHP-podcast-episode-68.html
The original content is as follows:
Operator overloading is a feature being proposed for PHP 7.1 that will allow using regular operators, like +,-, *,/, to perform operations with class objects using new magic methods. that was one of the main topics discussed by Manuel Lemos and Arturs Sosins in the episode 68 of the Lately in PHP podcast hangout.
They also talked about better handling of bugs caused by using invalid string values in each operations, supporting negative string offsets in all string operations, and better handling of issues caused by the regeneration of session IDs.
They also talked about the recent vicement of Dave Smith and the United States team in the PHP Innovation Award, as well the improvements to the PHP Classes site features for promoting contributing authors work suggested by these winning authors.
Listen to the podcast, or watch the hangout video to learn more about these interesting PHP topics.
There are videos and recordings discussed in the original article address. of course you have to see them.
Well, I have experienced operator overloading in Scala, and its actual programming significance is not big. obj-> add (x) or obj-> plus (x) and obj + x, in fact, I may prefer the former. After all, PHP is not completely object-oriented. although the reference problem has been significantly improved in PHP 7, object reference may still cause many unknown bugs. Will the addition of Operation Overload cause some disasters? In fact, PHP 7.0.3 still has a lot of unclosed bugs at the moment, so it is better to be cautious (today we seem to have found another bug in array_object ....).
Er, it seems that Scala has been mentioned in the video. what I want to say is that Scala has many things that are not completely good.
I still hope PHP can maintain the purity of some language. C # is terrible, and Js is also broken down by node. js.
Finally, try again the php rfc: https://wiki.php.net/rfc.