diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-05-25 12:47:43 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-05-25 12:47:43 +0300 |
commit | 27e7aea4124ffdecb6d40a2f5723e413a7b40562 (patch) | |
tree | 339f9ea525134eafc552fc7f7d4900b0dc656e1f /ext | |
parent | 44ec732752a99334985759a569814bab05d95051 (diff) | |
download | php-git-27e7aea4124ffdecb6d40a2f5723e413a7b40562.tar.gz |
"Countable" interface is moved from SPL to Core
Diffstat (limited to 'ext')
-rw-r--r-- | ext/phar/phar_object.c | 4 | ||||
-rw-r--r-- | ext/simplexml/sxe.c | 2 | ||||
-rw-r--r-- | ext/spl/php_spl.c | 1 | ||||
-rwxr-xr-x | ext/spl/spl.php | 2 | ||||
-rw-r--r-- | ext/spl/spl_iterators.c | 7 | ||||
-rw-r--r-- | ext/spl/spl_iterators.h | 2 | ||||
-rw-r--r-- | ext/standard/array.c | 2 |
7 files changed, 6 insertions, 14 deletions
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index f94aa19de7..694b4b9377 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -5403,12 +5403,12 @@ void phar_object_init(void) /* {{{ */ INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods); phar_ce_archive = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator); - zend_class_implements(phar_ce_archive, 2, spl_ce_Countable, zend_ce_arrayaccess); + zend_class_implements(phar_ce_archive, 2, zend_ce_countable, zend_ce_arrayaccess); INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods); phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator); - zend_class_implements(phar_ce_data, 2, spl_ce_Countable, zend_ce_arrayaccess); + zend_class_implements(phar_ce_data, 2, zend_ce_countable, zend_ce_arrayaccess); INIT_CLASS_ENTRY(ce, "PharFileInfo", php_entry_methods); phar_ce_entry = zend_register_internal_class_ex(&ce, spl_ce_SplFileInfo); diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c index e1fbc63872..cb15f007d9 100644 --- a/ext/simplexml/sxe.c +++ b/ext/simplexml/sxe.c @@ -211,7 +211,7 @@ PHP_MINIT_FUNCTION(sxe) /* {{{ */ ce_SimpleXMLIterator->create_object = ce_SimpleXMLElement->create_object; zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_RecursiveIterator); - zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_Countable); + zend_class_implements(ce_SimpleXMLIterator, 1, zend_ce_countable); return SUCCESS; } diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 092fc54872..34b54e81e1 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -184,7 +184,6 @@ PHP_FUNCTION(class_uses) SPL_ADD_CLASS(BadMethodCallException, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(CachingIterator, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(CallbackFilterIterator, z_list, sub, allow, ce_flags); \ - SPL_ADD_CLASS(Countable, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(DirectoryIterator, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(DomainException, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(EmptyIterator, z_list, sub, allow, ce_flags); \ diff --git a/ext/spl/spl.php b/ext/spl/spl.php index ff9d1b6bbe..8a68613417 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -566,7 +566,7 @@ interface Iterator extends Traversable function valid(); } -/** @ingroup SPL +/** @ingroup ZendEngine * @brief This Interface allows to hook into the global count() function. * @since PHP 5.1 */ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 6690c4a8f7..0048f2107d 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -60,7 +60,6 @@ PHPAPI zend_class_entry *spl_ce_EmptyIterator; PHPAPI zend_class_entry *spl_ce_AppendIterator; PHPAPI zend_class_entry *spl_ce_RegexIterator; PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator; -PHPAPI zend_class_entry *spl_ce_Countable; PHPAPI zend_class_entry *spl_ce_RecursiveTreeIterator; ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_void, 0) @@ -3670,11 +3669,6 @@ static const zend_function_entry spl_funcs_OuterIterator[] = { PHP_FE_END }; -static const zend_function_entry spl_funcs_Countable[] = { - SPL_ABSTRACT_ME(Countable, count, arginfo_recursive_it_void) - PHP_FE_END -}; - /* {{{ PHP_MINIT_FUNCTION(spl_iterators) */ PHP_MINIT_FUNCTION(spl_iterators) @@ -3729,7 +3723,6 @@ PHP_MINIT_FUNCTION(spl_iterators) REGISTER_SPL_SUB_CLASS_EX(ParentIterator, RecursiveFilterIterator, spl_dual_it_new, spl_funcs_ParentIterator); - REGISTER_SPL_INTERFACE(Countable); REGISTER_SPL_INTERFACE(SeekableIterator); REGISTER_SPL_ITERATOR(SeekableIterator); diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h index f9b84b7390..dd86c0ea9a 100644 --- a/ext/spl/spl_iterators.h +++ b/ext/spl/spl_iterators.h @@ -32,6 +32,7 @@ #define spl_ce_Aggregate zend_ce_aggregate #define spl_ce_ArrayAccess zend_ce_arrayaccess #define spl_ce_Serializable zend_ce_serializable +#define spl_ce_Countable zend_ce_countable extern PHPAPI zend_class_entry *spl_ce_RecursiveIterator; extern PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator; @@ -51,7 +52,6 @@ extern PHPAPI zend_class_entry *spl_ce_EmptyIterator; extern PHPAPI zend_class_entry *spl_ce_AppendIterator; extern PHPAPI zend_class_entry *spl_ce_RegexIterator; extern PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator; -extern PHPAPI zend_class_entry *spl_ce_Countable; extern PHPAPI zend_class_entry *spl_ce_CallbackFilterIterator; extern PHPAPI zend_class_entry *spl_ce_RecursiveCallbackFilterIterator; diff --git a/ext/standard/array.c b/ext/standard/array.c index 2744ee3306..8968f4f821 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -813,7 +813,7 @@ PHP_FUNCTION(count) } } /* if not and the object implements Countable we call its count() method */ - if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(array), zend_ce_countable)) { zend_call_method_with_0_params(array, NULL, NULL, "count", &retval); if (Z_TYPE(retval) != IS_UNDEF) { RETVAL_LONG(zval_get_long(&retval)); |