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 revisionBoth sides next revision
rfc:object_cast_to_types [2012/03/04 01:23] – [Handler Behavior] ircmaxellrfc:object_cast_to_types [2012/03/04 01:24] – [Syntax] ircmaxell
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 ====
rfc/object_cast_to_types.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1