====== PHP RFC: Separate overloaded operations when assigning ====== * Version: 0.1 * Date: 2016-01-03 * Author: Sara Golemon * Status: Draft * First Published at: http://wiki.php.net/rfc/assignment-overloading ===== Introduction ===== PHP allows for basic operator overloading for builtin objects. For example, in the following code, gmp_init() produces an object instance of class "GMP", yet the addition operation is not only valid, it produces a valid result (a new object with an updated value). 125 } Specifically, the following basic operators are overloaded: + - * / %%**%% . In addition, the assignment versions of these operators ( += -= *= /= %%**%%= .= ) are supported by executing a normal operation followed by a store. Thus the following two blocks of code are effectively identical. 123 } while $h is pointing at object(GMP)#2 { ["num"]=>125 } It could be argues that an add-assign operation is exactly that: "add & assign", but the same holds true of the pre/post inc/dec operators: