rfc:object_cast_to_types

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
Next revisionBoth sides next revision
rfc:object_cast_to_types [2012/03/04 01:23] – [Handler Behavior] ircmaxellrfc:object_cast_to_types [2013/09/03 12:28] – Withdrawn ircmaxell
Line 3: Line 3:
   * Date: 2012-03-03   * Date: 2012-03-03
   * Author: Anthony Ferrara <ircmaxell@php.net>   * Author: Anthony Ferrara <ircmaxell@php.net>
-  * Status: In Draft+  * Status: Withdrawn
   * Patch: https://gist.github.com/1966809   * Patch: https://gist.github.com/1966809
  
Line 25: Line 25:
 This RFC and patch introduces 4 new magic methods: This RFC and patch introduces 4 new magic methods:
  
- * ''__toInt()'' - Called when casting an object explicitly to an integer (or passing it to an internal function which expects an integer) +  * ''_ _toInt()'' - Called when casting an object explicitly to an integer (or passing it to an internal function which expects an integer) 
- * ''__toFloat()'' - Called when casting an object explicitly to a float (or passing it to an internal function which expects a float) +  * ''_ _toFloat()'' - Called when casting an object explicitly to a float (or passing it to an internal function which expects a float) 
- * ''__toArray()'' - Called when casting an object explicitly to an array (or passing it to an internal function which expects an array) +  * ''_ _toArray()'' - Called when casting an object explicitly to an array (or passing it to an internal function which expects an array) 
- * ''__toScalar()'' - Called when using an object in an implicit scalar scope without type information (for example: ''$obj + 1'').+  * ''_ _toScalar()'' - Called when using an object in an implicit scalar scope without type information (for example: ''$obj + 1'').
  
 ==== Handler Behavior ==== ==== Handler Behavior ====
Line 65: Line 65:
   * https://wiki.php.net/internals/engine/objects#set   * https://wiki.php.net/internals/engine/objects#set
   * https://wiki.php.net/internals/engine/objects#cast_object   * https://wiki.php.net/internals/engine/objects#cast_object
- 
rfc/object_cast_to_types.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1