Does PHP7.1 support operator overloading?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.