« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for endregion (0.000 sec.)
Operator Overloading Magic Methods | PHP 8.3 9414
Operator Overloading Magic Methods The operator overloading extension allows you to define how an object reacts to operators. This is done by implementing the following magic methods: Arithmetic operators: $a::__add($b) $a::__sub($b) $a::__ ... d $value ) { $this -> value = $value ; } public function __construct ( mixed $init = null ) { $this -> value = $init ; } //endregion //region Arithmetic Operators public function __add ( mixed $val ): int | float { return $this -> value + $val ; } public ... { return $this -> value ** $val ; } public function __sub ( mixed $val ): int | float { return $this -> value - $val ; } //endregion //region Assignment Operators public function __assign ( mixed $val ): mixed { return $this -> value = $val ; } public fun ... eturn $this -> value >>= $val ; } public function __assign_sub ( mixed $val ): mixed { return $this -> value -= $val ; } //endregion //region Bitwise Operators public function __bw_and ( mixed $val ): int { return $this -> value & $val ; } public function ...
https://man.mtool.work/php/8.3/operator.overloading.html
PREV 1 NEXT