summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/base.h b/include/base.h
index ed6936d..6541549 100644
--- a/include/base.h
+++ b/include/base.h
@@ -179,6 +179,47 @@ public:
*/
virtual Value __invoke(Parameters &params);
+ /**
+ * Cast the object to a string
+ *
+ * This method is called when an object is casted to a string, or when
+ * it is used in a string context
+ *
+ * @return Value The object as a string
+ */
+ virtual Value __toString();
+
+ /**
+ * Cast the object to an integer
+ *
+ * This method is called when an object is casted to an integer, or when
+ * it is used in an integer context
+ *
+ * @return int Integer value
+ */
+ virtual long __toInteger();
+
+ /**
+ * Cast the object to a float
+ *
+ * This method is called when an object is casted to a float, or when it
+ * is used in a float context
+ *
+ * @return double Floating point value
+ */
+ virtual double __toFloat();
+
+ /**
+ * Cast the object to a boolean
+ *
+ * This method is called when an object is casted to a bool, or when it
+ * is used in a boolean context
+ *
+ * @return bool
+ */
+ virtual bool __toBool();
+
+
private:
/**
* Store the object in the zend object cache