PHP 8.2.32 Released!

Operator Overloading for Objects

简介

This extension defines and implements operator overloading for objects. It allows defining how an object reacts when an operator is used on it.

One example of this is creating a collection type object that has the addition operator overloaded to allow adding elements to the collection or adding two collections together.

Another example is creating an enhanced string class that has the multiplication operator overloaded to allow repeating the string a certain number of times.

发现了问题?

了解如何改进此页面提交拉取请求报告一个错误
+添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

AltStyle によって変換されたページ (->オリジナル) /