diff options
| author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2020-01-13 17:06:26 +0100 |
|---|---|---|
| committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2020-03-02 15:25:32 +0100 |
| commit | 9e775db02567d3b90694ebb43f0225875a48e8c9 (patch) | |
| tree | cd25ebdb5e735ca322eded189b156619a4b43534 /Zend/zend_interfaces.c | |
| parent | c06850b9fa1b6dc8f4f8a46d6d0ea55e8baf7cbf (diff) | |
| download | php-git-9e775db02567d3b90694ebb43f0225875a48e8c9.tar.gz | |
Define Stringable with __toString():string method
Diffstat (limited to 'Zend/zend_interfaces.c')
| -rw-r--r-- | Zend/zend_interfaces.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index b6fdec95be..db42202571 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -28,6 +28,7 @@ ZEND_API zend_class_entry *zend_ce_iterator; ZEND_API zend_class_entry *zend_ce_arrayaccess; ZEND_API zend_class_entry *zend_ce_serializable; ZEND_API zend_class_entry *zend_ce_countable; +ZEND_API zend_class_entry *zend_ce_stringable; /* {{{ zend_call_method Only returns the returned zval if retval_ptr != NULL */ @@ -567,6 +568,11 @@ static const zend_function_entry zend_funcs_countable[] = { ZEND_ABSTRACT_ME(Countable, count, arginfo_class_Countable_count) ZEND_FE_END }; + +static const zend_function_entry zend_funcs_stringable[] = { + ZEND_ABSTRACT_ME(Stringable, __toString, arginfo_class_Stringable___toString) + ZEND_FE_END +}; /* }}} */ /* {{{ zend_register_interfaces */ @@ -585,5 +591,9 @@ ZEND_API void zend_register_interfaces(void) REGISTER_MAGIC_INTERFACE(serializable, Serializable); REGISTER_MAGIC_INTERFACE(countable, Countable); + + zend_class_entry ce; + INIT_CLASS_ENTRY(ce, "Stringable", zend_funcs_stringable); + zend_ce_stringable = zend_register_internal_interface(&ce); } /* }}} */ |
