rfc:operator_overloading_gmp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:operator_overloading_gmp [2013/06/08 12:52] nikicrfc:operator_overloading_gmp [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 4: Line 4:
   * Date: 2013-05-12   * Date: 2013-05-12
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
-  * Status: Under Discussion+  * Status: Implemented in PHP 5.6
   * Patch: https://github.com/php/php-src/pull/342   * Patch: https://github.com/php/php-src/pull/342
-  * Target version: PHP 5.6 (or whatever the next one is) 
  
 ===== Introduction ===== ===== Introduction =====
Line 84: Line 83:
   * Vector and matrix calculations   * Vector and matrix calculations
  
-Of course the operator overloading should only be used in situations where the meaning of the operators is well-defined and preserves the usual semantics of the operators. Zeev's example for an invalid application of overloading: "Incrementing or decrementing picture object to change the white balance"+Due to potential pitfalls of misusing operator overloading known from other languages (most notably C++), the use of this new feature should be limited to cases where there are clear definitions to the behavior of all overloaded operators. The application of this feature should be for mathematical use cases only (as noted above), and not 'creative' applications such as changing the white balance of a picture by incrementing or decrementing the picture object.
  
 ==== Technical proposal ==== ==== Technical proposal ====
Line 296: Line 295:
  
 The pull request for this RFC can be found here: https://github.com/php/php-src/pull/342 The pull request for this RFC can be found here: https://github.com/php/php-src/pull/342
 +
 +===== Vote =====
 +
 +The vote started on 10.06.2013 and ended on 17.06.2013. Both proposals are accepted.
 +
 +<doodle title="Should these changes be applied for PHP 5.6?" auth="nikic" voteType="multi" closed="true">
 +   * Internal operator overloading
 +   * GMP changes
 +   * None
 +</doodle>
  
 ===== Previous discussions ===== ===== Previous discussions =====
  
 http://markmail.org/message/y7rq5vcd5ucsbcyb: This is a rather old discussion on userland operator overloading (so not really the same as this). The patch discussed there is no longer accessible. http://markmail.org/message/y7rq5vcd5ucsbcyb: This is a rather old discussion on userland operator overloading (so not really the same as this). The patch discussed there is no longer accessible.
rfc/operator_overloading_gmp.1370695940.txt.gz · Last modified: 2017/09/22 13:28 (external edit)