mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
Declare ext/spl constants in stubs (#9226)
This commit is contained in:
parent
6a7fd48aae
commit
b73f139c70
@ -27,11 +27,11 @@
|
||||
#include "zend_exceptions.h"
|
||||
|
||||
#include "php_spl.h"
|
||||
#include "spl_array_arginfo.h"
|
||||
#include "spl_functions.h"
|
||||
#include "spl_engine.h"
|
||||
#include "spl_iterators.h"
|
||||
#include "spl_array.h"
|
||||
#include "spl_array_arginfo.h"
|
||||
#include "spl_exceptions.h"
|
||||
|
||||
zend_object_handlers spl_handler_ArrayObject;
|
||||
@ -41,18 +41,6 @@ zend_object_handlers spl_handler_ArrayIterator;
|
||||
PHPAPI zend_class_entry *spl_ce_ArrayIterator;
|
||||
PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator;
|
||||
|
||||
#define SPL_ARRAY_STD_PROP_LIST 0x00000001
|
||||
#define SPL_ARRAY_ARRAY_AS_PROPS 0x00000002
|
||||
#define SPL_ARRAY_CHILD_ARRAYS_ONLY 0x00000004
|
||||
#define SPL_ARRAY_IS_SELF 0x01000000
|
||||
#define SPL_ARRAY_USE_OTHER 0x02000000
|
||||
#define SPL_ARRAY_INT_MASK 0xFFFF0000
|
||||
#define SPL_ARRAY_CLONE_MASK 0x0100FFFF
|
||||
|
||||
#define SPL_ARRAY_METHOD_NO_ARG 0
|
||||
#define SPL_ARRAY_METHOD_CALLBACK_ARG 1
|
||||
#define SPL_ARRAY_METHOD_SORT_FLAGS_ARG 2
|
||||
|
||||
typedef struct _spl_array_object {
|
||||
zval array;
|
||||
uint32_t ht_iter;
|
||||
@ -1819,18 +1807,10 @@ PHP_MINIT_FUNCTION(spl_array)
|
||||
|
||||
memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers));
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
|
||||
|
||||
spl_ce_RecursiveArrayIterator = register_class_RecursiveArrayIterator(spl_ce_ArrayIterator, spl_ce_RecursiveIterator);
|
||||
spl_ce_RecursiveArrayIterator->create_object = spl_array_object_new;
|
||||
spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveArrayIterator, "CHILD_ARRAYS_ONLY", SPL_ARRAY_CHILD_ARRAYS_ONLY);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -21,6 +21,18 @@
|
||||
#include "php_spl.h"
|
||||
#include "spl_iterators.h"
|
||||
|
||||
#define SPL_ARRAY_STD_PROP_LIST 0x00000001
|
||||
#define SPL_ARRAY_ARRAY_AS_PROPS 0x00000002
|
||||
#define SPL_ARRAY_CHILD_ARRAYS_ONLY 0x00000004
|
||||
#define SPL_ARRAY_IS_SELF 0x01000000
|
||||
#define SPL_ARRAY_USE_OTHER 0x02000000
|
||||
#define SPL_ARRAY_INT_MASK 0xFFFF0000
|
||||
#define SPL_ARRAY_CLONE_MASK 0x0100FFFF
|
||||
|
||||
#define SPL_ARRAY_METHOD_NO_ARG 0
|
||||
#define SPL_ARRAY_METHOD_CALLBACK_ARG 1
|
||||
#define SPL_ARRAY_METHOD_SORT_FLAGS_ARG 2
|
||||
|
||||
extern PHPAPI zend_class_entry *spl_ce_ArrayObject;
|
||||
extern PHPAPI zend_class_entry *spl_ce_ArrayIterator;
|
||||
extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator;
|
||||
|
@ -4,6 +4,17 @@
|
||||
|
||||
class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_ARRAY_STD_PROP_LIST
|
||||
*/
|
||||
const STD_PROP_LIST = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_ARRAY_ARRAY_AS_PROPS
|
||||
*/
|
||||
const ARRAY_AS_PROPS = UNKNOWN;
|
||||
|
||||
public function __construct(array|object $array = [], int $flags = 0, string $iteratorClass = ArrayIterator::class) {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
@ -81,6 +92,17 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
|
||||
|
||||
class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Countable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_ARRAY_STD_PROP_LIST
|
||||
*/
|
||||
public const STD_PROP_LIST = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_ARRAY_ARRAY_AS_PROPS
|
||||
*/
|
||||
public const ARRAY_AS_PROPS = UNKNOWN;
|
||||
|
||||
public function __construct(array|object $array = [], int $flags = 0) {}
|
||||
|
||||
/**
|
||||
@ -224,6 +246,12 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
|
||||
|
||||
class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_ARRAY_CHILD_ARRAYS_ONLY
|
||||
*/
|
||||
public const CHILD_ARRAYS_ONLY = UNKNOWN;
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function hasChildren(): bool {}
|
||||
|
||||
|
32
ext/spl/spl_array_arginfo.h
generated
32
ext/spl/spl_array_arginfo.h
generated
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: e8e9909c2548a2259ba58ecf9f2ad6fe5add70f4 */
|
||||
* Stub hash: 13e1f68463c2abc1a1ce0e1cff5f47a12407cfc1 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0)
|
||||
ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")
|
||||
@ -265,6 +265,18 @@ static zend_class_entry *register_class_ArrayObject(zend_class_entry *class_entr
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
zend_class_implements(class_entry, 4, class_entry_IteratorAggregate, class_entry_ArrayAccess, class_entry_Serializable, class_entry_Countable);
|
||||
|
||||
zval const_STD_PROP_LIST_value;
|
||||
ZVAL_LONG(&const_STD_PROP_LIST_value, SPL_ARRAY_STD_PROP_LIST);
|
||||
zend_string *const_STD_PROP_LIST_name = zend_string_init_interned("STD_PROP_LIST", sizeof("STD_PROP_LIST") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_STD_PROP_LIST_name, &const_STD_PROP_LIST_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_STD_PROP_LIST_name);
|
||||
|
||||
zval const_ARRAY_AS_PROPS_value;
|
||||
ZVAL_LONG(&const_ARRAY_AS_PROPS_value, SPL_ARRAY_ARRAY_AS_PROPS);
|
||||
zend_string *const_ARRAY_AS_PROPS_name = zend_string_init_interned("ARRAY_AS_PROPS", sizeof("ARRAY_AS_PROPS") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_ARRAY_AS_PROPS_name, &const_ARRAY_AS_PROPS_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_ARRAY_AS_PROPS_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
@ -276,6 +288,18 @@ static zend_class_entry *register_class_ArrayIterator(zend_class_entry *class_en
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
zend_class_implements(class_entry, 4, class_entry_SeekableIterator, class_entry_ArrayAccess, class_entry_Serializable, class_entry_Countable);
|
||||
|
||||
zval const_STD_PROP_LIST_value;
|
||||
ZVAL_LONG(&const_STD_PROP_LIST_value, SPL_ARRAY_STD_PROP_LIST);
|
||||
zend_string *const_STD_PROP_LIST_name = zend_string_init_interned("STD_PROP_LIST", sizeof("STD_PROP_LIST") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_STD_PROP_LIST_name, &const_STD_PROP_LIST_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_STD_PROP_LIST_name);
|
||||
|
||||
zval const_ARRAY_AS_PROPS_value;
|
||||
ZVAL_LONG(&const_ARRAY_AS_PROPS_value, SPL_ARRAY_ARRAY_AS_PROPS);
|
||||
zend_string *const_ARRAY_AS_PROPS_name = zend_string_init_interned("ARRAY_AS_PROPS", sizeof("ARRAY_AS_PROPS") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_ARRAY_AS_PROPS_name, &const_ARRAY_AS_PROPS_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_ARRAY_AS_PROPS_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
@ -287,5 +311,11 @@ static zend_class_entry *register_class_RecursiveArrayIterator(zend_class_entry
|
||||
class_entry = zend_register_internal_class_ex(&ce, class_entry_ArrayIterator);
|
||||
zend_class_implements(class_entry, 1, class_entry_RecursiveIterator);
|
||||
|
||||
zval const_CHILD_ARRAYS_ONLY_value;
|
||||
ZVAL_LONG(&const_CHILD_ARRAYS_ONLY_value, SPL_ARRAY_CHILD_ARRAYS_ONLY);
|
||||
zend_string *const_CHILD_ARRAYS_ONLY_name = zend_string_init_interned("CHILD_ARRAYS_ONLY", sizeof("CHILD_ARRAYS_ONLY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CHILD_ARRAYS_ONLY_name, &const_CHILD_ARRAYS_ONLY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CHILD_ARRAYS_ONLY_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
@ -2772,19 +2772,6 @@ PHP_MINIT_FUNCTION(spl_directory)
|
||||
spl_ce_FilesystemIterator->create_object = spl_filesystem_object_new;
|
||||
spl_ce_FilesystemIterator->get_iterator = spl_filesystem_tree_get_iterator;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "CURRENT_MODE_MASK", SPL_FILE_DIR_CURRENT_MODE_MASK);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "CURRENT_AS_PATHNAME", SPL_FILE_DIR_CURRENT_AS_PATHNAME);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "CURRENT_AS_FILEINFO", SPL_FILE_DIR_CURRENT_AS_FILEINFO);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "CURRENT_AS_SELF", SPL_FILE_DIR_CURRENT_AS_SELF);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "KEY_MODE_MASK", SPL_FILE_DIR_KEY_MODE_MASK);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "KEY_AS_PATHNAME", SPL_FILE_DIR_KEY_AS_PATHNAME);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "FOLLOW_SYMLINKS", SPL_FILE_DIR_FOLLOW_SYMLINKS);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "KEY_AS_FILENAME", SPL_FILE_DIR_KEY_AS_FILENAME);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "NEW_CURRENT_AND_KEY", SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "OTHER_MODE_MASK", SPL_FILE_DIR_OTHERS_MASK);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "SKIP_DOTS", SPL_FILE_DIR_SKIPDOTS);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(FilesystemIterator, "UNIX_PATHS", SPL_FILE_DIR_UNIXPATHS);
|
||||
|
||||
spl_ce_RecursiveDirectoryIterator = register_class_RecursiveDirectoryIterator(spl_ce_FilesystemIterator, spl_ce_RecursiveIterator);
|
||||
spl_ce_RecursiveDirectoryIterator->create_object = spl_filesystem_object_new;
|
||||
|
||||
@ -2800,11 +2787,6 @@ PHP_MINIT_FUNCTION(spl_directory)
|
||||
spl_ce_SplFileObject = register_class_SplFileObject(spl_ce_SplFileInfo, spl_ce_RecursiveIterator, spl_ce_SeekableIterator);
|
||||
spl_ce_SplFileObject->create_object = spl_filesystem_object_new_check;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "DROP_NEW_LINE", SPL_FILE_OBJECT_DROP_NEW_LINE);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "READ_AHEAD", SPL_FILE_OBJECT_READ_AHEAD);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "SKIP_EMPTY", SPL_FILE_OBJECT_SKIP_EMPTY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "READ_CSV", SPL_FILE_OBJECT_READ_CSV);
|
||||
|
||||
spl_ce_SplTempFileObject = register_class_SplTempFileObject(spl_ce_SplFileObject);
|
||||
spl_ce_SplTempFileObject->create_object = spl_filesystem_object_new_check;
|
||||
|
||||
|
@ -105,6 +105,7 @@ struct _spl_filesystem_object {
|
||||
#define SPL_FILE_DIR_KEY_AS_PATHNAME 0x00000000 /* make RecursiveDirectoryTree::key() return getPathname() */
|
||||
#define SPL_FILE_DIR_KEY_AS_FILENAME 0x00000100 /* make RecursiveDirectoryTree::key() return getFilename() */
|
||||
#define SPL_FILE_DIR_KEY_MODE_MASK 0x00000F00 /* mask RecursiveDirectoryTree::key() */
|
||||
#define SPL_FILE_NEW_CURRENT_AND_KEY SPL_FILE_DIR_KEY_AS_FILENAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO
|
||||
#define SPL_FILE_DIR_KEY(intern,mode) ((intern->flags&SPL_FILE_DIR_KEY_MODE_MASK)==mode)
|
||||
|
||||
#define SPL_FILE_DIR_SKIPDOTS 0x00001000 /* Tells whether it should skip dots or not */
|
||||
|
@ -150,6 +150,67 @@ class DirectoryIterator extends SplFileInfo implements SeekableIterator
|
||||
|
||||
class FilesystemIterator extends DirectoryIterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_CURRENT_MODE_MASK
|
||||
*/
|
||||
public const CURRENT_MODE_MASK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_CURRENT_AS_PATHNAME
|
||||
*/
|
||||
public const CURRENT_AS_PATHNAME = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_CURRENT_AS_FILEINFO
|
||||
*/
|
||||
public const CURRENT_AS_FILEINFO = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_CURRENT_AS_SELF
|
||||
*/
|
||||
public const CURRENT_AS_SELF = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_KEY_MODE_MASK
|
||||
*/
|
||||
public const KEY_MODE_MASK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_KEY_AS_PATHNAME
|
||||
*/
|
||||
public const KEY_AS_PATHNAME = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_FOLLOW_SYMLINKS
|
||||
*/
|
||||
public const FOLLOW_SYMLINKS = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_KEY_AS_FILENAME
|
||||
*/
|
||||
public const KEY_AS_FILENAME = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_NEW_CURRENT_AND_KEY
|
||||
*/
|
||||
public const NEW_CURRENT_AND_KEY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_OTHERS_MASK
|
||||
*/
|
||||
public const OTHER_MODE_MASK = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_SKIPDOTS
|
||||
*/
|
||||
public const SKIP_DOTS = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_DIR_UNIXPATHS
|
||||
*/
|
||||
public const UNIX_PATHS = UNKNOWN;
|
||||
|
||||
public function __construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS) {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
@ -197,6 +258,27 @@ class GlobIterator extends FilesystemIterator implements Countable
|
||||
|
||||
class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_OBJECT_DROP_NEW_LINE
|
||||
*/
|
||||
public const DROP_NEW_LINE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_OBJECT_READ_AHEAD
|
||||
*/
|
||||
public const READ_AHEAD = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_OBJECT_SKIP_EMPTY
|
||||
*/
|
||||
public const SKIP_EMPTY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_FILE_OBJECT_READ_CSV
|
||||
*/
|
||||
public const READ_CSV = UNKNOWN;
|
||||
|
||||
/** @param resource|null $context */
|
||||
public function __construct(string $filename, string $mode = "r", bool $useIncludePath = false, $context = null) {}
|
||||
|
||||
|
98
ext/spl/spl_directory_arginfo.h
generated
98
ext/spl/spl_directory_arginfo.h
generated
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: a5789c24c7ba9dd1d266ee3534e6e459bca29630 */
|
||||
* Stub hash: 06f914771f457db2308473ad072d594f2c6c1ae0 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
|
||||
@ -519,6 +519,78 @@ static zend_class_entry *register_class_FilesystemIterator(zend_class_entry *cla
|
||||
INIT_CLASS_ENTRY(ce, "FilesystemIterator", class_FilesystemIterator_methods);
|
||||
class_entry = zend_register_internal_class_ex(&ce, class_entry_DirectoryIterator);
|
||||
|
||||
zval const_CURRENT_MODE_MASK_value;
|
||||
ZVAL_LONG(&const_CURRENT_MODE_MASK_value, SPL_FILE_DIR_CURRENT_MODE_MASK);
|
||||
zend_string *const_CURRENT_MODE_MASK_name = zend_string_init_interned("CURRENT_MODE_MASK", sizeof("CURRENT_MODE_MASK") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CURRENT_MODE_MASK_name, &const_CURRENT_MODE_MASK_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CURRENT_MODE_MASK_name);
|
||||
|
||||
zval const_CURRENT_AS_PATHNAME_value;
|
||||
ZVAL_LONG(&const_CURRENT_AS_PATHNAME_value, SPL_FILE_DIR_CURRENT_AS_PATHNAME);
|
||||
zend_string *const_CURRENT_AS_PATHNAME_name = zend_string_init_interned("CURRENT_AS_PATHNAME", sizeof("CURRENT_AS_PATHNAME") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CURRENT_AS_PATHNAME_name, &const_CURRENT_AS_PATHNAME_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CURRENT_AS_PATHNAME_name);
|
||||
|
||||
zval const_CURRENT_AS_FILEINFO_value;
|
||||
ZVAL_LONG(&const_CURRENT_AS_FILEINFO_value, SPL_FILE_DIR_CURRENT_AS_FILEINFO);
|
||||
zend_string *const_CURRENT_AS_FILEINFO_name = zend_string_init_interned("CURRENT_AS_FILEINFO", sizeof("CURRENT_AS_FILEINFO") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CURRENT_AS_FILEINFO_name, &const_CURRENT_AS_FILEINFO_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CURRENT_AS_FILEINFO_name);
|
||||
|
||||
zval const_CURRENT_AS_SELF_value;
|
||||
ZVAL_LONG(&const_CURRENT_AS_SELF_value, SPL_FILE_DIR_CURRENT_AS_SELF);
|
||||
zend_string *const_CURRENT_AS_SELF_name = zend_string_init_interned("CURRENT_AS_SELF", sizeof("CURRENT_AS_SELF") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CURRENT_AS_SELF_name, &const_CURRENT_AS_SELF_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CURRENT_AS_SELF_name);
|
||||
|
||||
zval const_KEY_MODE_MASK_value;
|
||||
ZVAL_LONG(&const_KEY_MODE_MASK_value, SPL_FILE_DIR_KEY_MODE_MASK);
|
||||
zend_string *const_KEY_MODE_MASK_name = zend_string_init_interned("KEY_MODE_MASK", sizeof("KEY_MODE_MASK") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_KEY_MODE_MASK_name, &const_KEY_MODE_MASK_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_KEY_MODE_MASK_name);
|
||||
|
||||
zval const_KEY_AS_PATHNAME_value;
|
||||
ZVAL_LONG(&const_KEY_AS_PATHNAME_value, SPL_FILE_DIR_KEY_AS_PATHNAME);
|
||||
zend_string *const_KEY_AS_PATHNAME_name = zend_string_init_interned("KEY_AS_PATHNAME", sizeof("KEY_AS_PATHNAME") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_KEY_AS_PATHNAME_name, &const_KEY_AS_PATHNAME_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_KEY_AS_PATHNAME_name);
|
||||
|
||||
zval const_FOLLOW_SYMLINKS_value;
|
||||
ZVAL_LONG(&const_FOLLOW_SYMLINKS_value, SPL_FILE_DIR_FOLLOW_SYMLINKS);
|
||||
zend_string *const_FOLLOW_SYMLINKS_name = zend_string_init_interned("FOLLOW_SYMLINKS", sizeof("FOLLOW_SYMLINKS") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_FOLLOW_SYMLINKS_name, &const_FOLLOW_SYMLINKS_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_FOLLOW_SYMLINKS_name);
|
||||
|
||||
zval const_KEY_AS_FILENAME_value;
|
||||
ZVAL_LONG(&const_KEY_AS_FILENAME_value, SPL_FILE_DIR_KEY_AS_FILENAME);
|
||||
zend_string *const_KEY_AS_FILENAME_name = zend_string_init_interned("KEY_AS_FILENAME", sizeof("KEY_AS_FILENAME") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_KEY_AS_FILENAME_name, &const_KEY_AS_FILENAME_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_KEY_AS_FILENAME_name);
|
||||
|
||||
zval const_NEW_CURRENT_AND_KEY_value;
|
||||
ZVAL_LONG(&const_NEW_CURRENT_AND_KEY_value, SPL_FILE_NEW_CURRENT_AND_KEY);
|
||||
zend_string *const_NEW_CURRENT_AND_KEY_name = zend_string_init_interned("NEW_CURRENT_AND_KEY", sizeof("NEW_CURRENT_AND_KEY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_NEW_CURRENT_AND_KEY_name, &const_NEW_CURRENT_AND_KEY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_NEW_CURRENT_AND_KEY_name);
|
||||
|
||||
zval const_OTHER_MODE_MASK_value;
|
||||
ZVAL_LONG(&const_OTHER_MODE_MASK_value, SPL_FILE_DIR_OTHERS_MASK);
|
||||
zend_string *const_OTHER_MODE_MASK_name = zend_string_init_interned("OTHER_MODE_MASK", sizeof("OTHER_MODE_MASK") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_OTHER_MODE_MASK_name, &const_OTHER_MODE_MASK_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_OTHER_MODE_MASK_name);
|
||||
|
||||
zval const_SKIP_DOTS_value;
|
||||
ZVAL_LONG(&const_SKIP_DOTS_value, SPL_FILE_DIR_SKIPDOTS);
|
||||
zend_string *const_SKIP_DOTS_name = zend_string_init_interned("SKIP_DOTS", sizeof("SKIP_DOTS") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_SKIP_DOTS_name, &const_SKIP_DOTS_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_SKIP_DOTS_name);
|
||||
|
||||
zval const_UNIX_PATHS_value;
|
||||
ZVAL_LONG(&const_UNIX_PATHS_value, SPL_FILE_DIR_UNIXPATHS);
|
||||
zend_string *const_UNIX_PATHS_name = zend_string_init_interned("UNIX_PATHS", sizeof("UNIX_PATHS") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_UNIX_PATHS_name, &const_UNIX_PATHS_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_UNIX_PATHS_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
@ -554,6 +626,30 @@ static zend_class_entry *register_class_SplFileObject(zend_class_entry *class_en
|
||||
class_entry = zend_register_internal_class_ex(&ce, class_entry_SplFileInfo);
|
||||
zend_class_implements(class_entry, 2, class_entry_RecursiveIterator, class_entry_SeekableIterator);
|
||||
|
||||
zval const_DROP_NEW_LINE_value;
|
||||
ZVAL_LONG(&const_DROP_NEW_LINE_value, SPL_FILE_OBJECT_DROP_NEW_LINE);
|
||||
zend_string *const_DROP_NEW_LINE_name = zend_string_init_interned("DROP_NEW_LINE", sizeof("DROP_NEW_LINE") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_DROP_NEW_LINE_name, &const_DROP_NEW_LINE_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_DROP_NEW_LINE_name);
|
||||
|
||||
zval const_READ_AHEAD_value;
|
||||
ZVAL_LONG(&const_READ_AHEAD_value, SPL_FILE_OBJECT_READ_AHEAD);
|
||||
zend_string *const_READ_AHEAD_name = zend_string_init_interned("READ_AHEAD", sizeof("READ_AHEAD") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_READ_AHEAD_name, &const_READ_AHEAD_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_READ_AHEAD_name);
|
||||
|
||||
zval const_SKIP_EMPTY_value;
|
||||
ZVAL_LONG(&const_SKIP_EMPTY_value, SPL_FILE_OBJECT_SKIP_EMPTY);
|
||||
zend_string *const_SKIP_EMPTY_name = zend_string_init_interned("SKIP_EMPTY", sizeof("SKIP_EMPTY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_SKIP_EMPTY_name, &const_SKIP_EMPTY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_SKIP_EMPTY_name);
|
||||
|
||||
zval const_READ_CSV_value;
|
||||
ZVAL_LONG(&const_READ_CSV_value, SPL_FILE_OBJECT_READ_CSV);
|
||||
zend_string *const_READ_CSV_name = zend_string_init_interned("READ_CSV", sizeof("READ_CSV") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_READ_CSV_name, &const_READ_CSV_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_READ_CSV_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
|
@ -51,11 +51,6 @@ PHPAPI zend_class_entry *spl_ce_SplStack;
|
||||
#define SPL_LLIST_ADDREF(elem) SPL_LLIST_RC(elem)++
|
||||
#define SPL_LLIST_CHECK_ADDREF(elem) if (elem) SPL_LLIST_RC(elem)++
|
||||
|
||||
#define SPL_DLLIST_IT_DELETE 0x00000001 /* Delete flag makes the iterator delete the current element on next */
|
||||
#define SPL_DLLIST_IT_LIFO 0x00000002 /* LIFO flag makes the iterator traverse the structure as a LastInFirstOut */
|
||||
#define SPL_DLLIST_IT_MASK 0x00000003 /* Mask to isolate flags related to iterators */
|
||||
#define SPL_DLLIST_IT_FIX 0x00000004 /* Backward/Forward bit is fixed */
|
||||
|
||||
#ifdef accept
|
||||
#undef accept
|
||||
#endif
|
||||
@ -1272,11 +1267,6 @@ PHP_MINIT_FUNCTION(spl_dllist) /* {{{ */
|
||||
spl_handler_SplDoublyLinkedList.get_gc = spl_dllist_object_get_gc;
|
||||
spl_handler_SplDoublyLinkedList.free_obj = spl_dllist_object_free_storage;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplDoublyLinkedList, "IT_MODE_LIFO", SPL_DLLIST_IT_LIFO);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplDoublyLinkedList, "IT_MODE_FIFO", 0);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplDoublyLinkedList, "IT_MODE_DELETE",SPL_DLLIST_IT_DELETE);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplDoublyLinkedList, "IT_MODE_KEEP", 0);
|
||||
|
||||
spl_ce_SplQueue = register_class_SplQueue(spl_ce_SplDoublyLinkedList);
|
||||
spl_ce_SplQueue->create_object = spl_dllist_object_new;
|
||||
spl_ce_SplQueue->get_iterator = spl_dllist_get_iterator;
|
||||
|
@ -20,6 +20,13 @@
|
||||
#include "php.h"
|
||||
#include "php_spl.h"
|
||||
|
||||
#define SPL_DLLIST_IT_KEEP 0x00000000
|
||||
#define SPL_DLLIST_IT_FIFO 0x00000000 /* FIFO flag makes the iterator traverse the structure as a FirstInFirstOut */
|
||||
#define SPL_DLLIST_IT_DELETE 0x00000001 /* Delete flag makes the iterator delete the current element on next */
|
||||
#define SPL_DLLIST_IT_LIFO 0x00000002 /* LIFO flag makes the iterator traverse the structure as a LastInFirstOut */
|
||||
#define SPL_DLLIST_IT_MASK 0x00000003 /* Mask to isolate flags related to iterators */
|
||||
#define SPL_DLLIST_IT_FIX 0x00000004 /* Backward/Forward bit is fixed */
|
||||
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplDoublyLinkedList;
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplQueue;
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplStack;
|
||||
|
@ -4,6 +4,27 @@
|
||||
|
||||
class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_DLLIST_IT_LIFO
|
||||
*/
|
||||
public const IT_MODE_LIFO = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_DLLIST_IT_FIFO
|
||||
*/
|
||||
public const IT_MODE_FIFO = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_DLLIST_IT_DELETE
|
||||
*/
|
||||
public const IT_MODE_DELETE = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_DLLIST_IT_KEEP
|
||||
*/
|
||||
public const IT_MODE_KEEP = UNKNOWN;
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function add(int $index, mixed $value): void {}
|
||||
|
||||
|
26
ext/spl/spl_dllist_arginfo.h
generated
26
ext/spl/spl_dllist_arginfo.h
generated
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 4631669bb268bb2c9e005fa7ee385245604c1d71 */
|
||||
* Stub hash: b88d228873f2d8e0caa583fd80c70ce2bfc51188 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplDoublyLinkedList_add, 0, 2, IS_VOID, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
|
||||
@ -162,6 +162,30 @@ static zend_class_entry *register_class_SplDoublyLinkedList(zend_class_entry *cl
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
zend_class_implements(class_entry, 4, class_entry_Iterator, class_entry_Countable, class_entry_ArrayAccess, class_entry_Serializable);
|
||||
|
||||
zval const_IT_MODE_LIFO_value;
|
||||
ZVAL_LONG(&const_IT_MODE_LIFO_value, SPL_DLLIST_IT_LIFO);
|
||||
zend_string *const_IT_MODE_LIFO_name = zend_string_init_interned("IT_MODE_LIFO", sizeof("IT_MODE_LIFO") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_IT_MODE_LIFO_name, &const_IT_MODE_LIFO_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_IT_MODE_LIFO_name);
|
||||
|
||||
zval const_IT_MODE_FIFO_value;
|
||||
ZVAL_LONG(&const_IT_MODE_FIFO_value, SPL_DLLIST_IT_FIFO);
|
||||
zend_string *const_IT_MODE_FIFO_name = zend_string_init_interned("IT_MODE_FIFO", sizeof("IT_MODE_FIFO") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_IT_MODE_FIFO_name, &const_IT_MODE_FIFO_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_IT_MODE_FIFO_name);
|
||||
|
||||
zval const_IT_MODE_DELETE_value;
|
||||
ZVAL_LONG(&const_IT_MODE_DELETE_value, SPL_DLLIST_IT_DELETE);
|
||||
zend_string *const_IT_MODE_DELETE_name = zend_string_init_interned("IT_MODE_DELETE", sizeof("IT_MODE_DELETE") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_IT_MODE_DELETE_name, &const_IT_MODE_DELETE_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_IT_MODE_DELETE_name);
|
||||
|
||||
zval const_IT_MODE_KEEP_value;
|
||||
ZVAL_LONG(&const_IT_MODE_KEEP_value, SPL_DLLIST_IT_KEEP);
|
||||
zend_string *const_IT_MODE_KEEP_name = zend_string_init_interned("IT_MODE_KEEP", sizeof("IT_MODE_KEEP") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_IT_MODE_KEEP_name, &const_IT_MODE_KEEP_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_IT_MODE_KEEP_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,6 @@
|
||||
|
||||
typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type);
|
||||
|
||||
#define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \
|
||||
zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value);
|
||||
|
||||
/* sub: whether to allow subclasses/interfaces
|
||||
allow = 0: allow all classes and interfaces
|
||||
allow > 0: allow all that match and mask ce_flags
|
||||
|
@ -33,11 +33,6 @@
|
||||
|
||||
#define SPL_HEAP_CORRUPTED 0x00000001
|
||||
|
||||
#define SPL_PQUEUE_EXTR_MASK 0x00000003
|
||||
#define SPL_PQUEUE_EXTR_BOTH 0x00000003
|
||||
#define SPL_PQUEUE_EXTR_DATA 0x00000001
|
||||
#define SPL_PQUEUE_EXTR_PRIORITY 0x00000002
|
||||
|
||||
zend_object_handlers spl_handler_SplHeap;
|
||||
zend_object_handlers spl_handler_SplPriorityQueue;
|
||||
|
||||
@ -1164,10 +1159,6 @@ PHP_MINIT_FUNCTION(spl_heap) /* {{{ */
|
||||
spl_handler_SplPriorityQueue.get_gc = spl_pqueue_object_get_gc;
|
||||
spl_handler_SplPriorityQueue.free_obj = spl_heap_object_free_storage;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplPriorityQueue, "EXTR_BOTH", SPL_PQUEUE_EXTR_BOTH);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplPriorityQueue, "EXTR_PRIORITY", SPL_PQUEUE_EXTR_PRIORITY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(SplPriorityQueue, "EXTR_DATA", SPL_PQUEUE_EXTR_DATA);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -20,6 +20,11 @@
|
||||
#include "php.h"
|
||||
#include "php_spl.h"
|
||||
|
||||
#define SPL_PQUEUE_EXTR_MASK 0x00000003
|
||||
#define SPL_PQUEUE_EXTR_BOTH 0x00000003
|
||||
#define SPL_PQUEUE_EXTR_DATA 0x00000001
|
||||
#define SPL_PQUEUE_EXTR_PRIORITY 0x00000002
|
||||
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplHeap;
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplMinHeap;
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplMaxHeap;
|
||||
|
@ -4,6 +4,22 @@
|
||||
|
||||
class SplPriorityQueue implements Iterator, Countable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_PQUEUE_EXTR_BOTH
|
||||
*/
|
||||
public const EXTR_BOTH = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_PQUEUE_EXTR_PRIORITY
|
||||
*/
|
||||
public const EXTR_PRIORITY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue SPL_PQUEUE_EXTR_DATA
|
||||
*/
|
||||
public const EXTR_DATA = UNKNOWN;
|
||||
|
||||
/** @tentative-return-type */
|
||||
public function compare(mixed $priority1, mixed $priority2): int {}
|
||||
|
||||
|
20
ext/spl/spl_heap_arginfo.h
generated
20
ext/spl/spl_heap_arginfo.h
generated
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 3bf2b34e1b63d9bb8dec6e013aafb9a861b40975 */
|
||||
* Stub hash: 8e4784e749d6c70174a0958e73e4e9907adcd4b5 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplPriorityQueue_compare, 0, 2, IS_LONG, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, priority1, IS_MIXED, 0)
|
||||
@ -169,6 +169,24 @@ static zend_class_entry *register_class_SplPriorityQueue(zend_class_entry *class
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
zend_class_implements(class_entry, 2, class_entry_Iterator, class_entry_Countable);
|
||||
|
||||
zval const_EXTR_BOTH_value;
|
||||
ZVAL_LONG(&const_EXTR_BOTH_value, SPL_PQUEUE_EXTR_BOTH);
|
||||
zend_string *const_EXTR_BOTH_name = zend_string_init_interned("EXTR_BOTH", sizeof("EXTR_BOTH") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_EXTR_BOTH_name, &const_EXTR_BOTH_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_EXTR_BOTH_name);
|
||||
|
||||
zval const_EXTR_PRIORITY_value;
|
||||
ZVAL_LONG(&const_EXTR_PRIORITY_value, SPL_PQUEUE_EXTR_PRIORITY);
|
||||
zend_string *const_EXTR_PRIORITY_name = zend_string_init_interned("EXTR_PRIORITY", sizeof("EXTR_PRIORITY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_EXTR_PRIORITY_name, &const_EXTR_PRIORITY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_EXTR_PRIORITY_name);
|
||||
|
||||
zval const_EXTR_DATA_value;
|
||||
ZVAL_LONG(&const_EXTR_DATA_value, SPL_PQUEUE_EXTR_DATA);
|
||||
zend_string *const_EXTR_DATA_name = zend_string_init_interned("EXTR_DATA", sizeof("EXTR_DATA") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_EXTR_DATA_name, &const_EXTR_DATA_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_EXTR_DATA_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
|
@ -60,19 +60,6 @@ PHPAPI zend_class_entry *spl_ce_RegexIterator;
|
||||
PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator;
|
||||
PHPAPI zend_class_entry *spl_ce_RecursiveTreeIterator;
|
||||
|
||||
typedef enum {
|
||||
RIT_LEAVES_ONLY = 0,
|
||||
RIT_SELF_FIRST = 1,
|
||||
RIT_CHILD_FIRST = 2
|
||||
} RecursiveIteratorMode;
|
||||
|
||||
#define RIT_CATCH_GET_CHILD CIT_CATCH_GET_CHILD
|
||||
|
||||
typedef enum {
|
||||
RTIT_BYPASS_CURRENT = 4,
|
||||
RTIT_BYPASS_KEY = 8
|
||||
} RecursiveTreeIteratorFlags;
|
||||
|
||||
typedef enum {
|
||||
RS_NEXT = 0,
|
||||
RS_TEST = 1,
|
||||
@ -3290,11 +3277,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
|
||||
spl_handlers_dual_it.free_obj = spl_dual_it_free_storage;
|
||||
spl_handlers_dual_it.get_gc = spl_dual_it_get_gc;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "LEAVES_ONLY", RIT_LEAVES_ONLY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "SELF_FIRST", RIT_SELF_FIRST);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "CHILD_FIRST", RIT_CHILD_FIRST);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "CATCH_GET_CHILD", RIT_CATCH_GET_CHILD);
|
||||
|
||||
spl_ce_IteratorIterator = register_class_IteratorIterator(spl_ce_OuterIterator);
|
||||
spl_ce_IteratorIterator->create_object = spl_dual_it_new;
|
||||
|
||||
@ -3321,13 +3303,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
|
||||
spl_ce_CachingIterator = register_class_CachingIterator(spl_ce_IteratorIterator, zend_ce_arrayaccess, zend_ce_countable, zend_ce_stringable);
|
||||
spl_ce_CachingIterator->create_object = spl_dual_it_new;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "CALL_TOSTRING", CIT_CALL_TOSTRING);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "CATCH_GET_CHILD", CIT_CATCH_GET_CHILD);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "TOSTRING_USE_KEY", CIT_TOSTRING_USE_KEY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "TOSTRING_USE_CURRENT", CIT_TOSTRING_USE_CURRENT);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "TOSTRING_USE_INNER", CIT_TOSTRING_USE_INNER);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, "FULL_CACHE", CIT_FULL_CACHE);
|
||||
|
||||
spl_ce_RecursiveCachingIterator = register_class_RecursiveCachingIterator(spl_ce_CachingIterator, spl_ce_RecursiveIterator);
|
||||
spl_ce_RecursiveCachingIterator->create_object = spl_dual_it_new;
|
||||
|
||||
@ -3343,14 +3318,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
|
||||
spl_ce_RegexIterator = register_class_RegexIterator(spl_ce_FilterIterator);
|
||||
spl_ce_RegexIterator->create_object = spl_dual_it_new;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "USE_KEY", REGIT_USE_KEY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "INVERT_MATCH",REGIT_INVERTED);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "MATCH", REGIT_MODE_MATCH);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "GET_MATCH", REGIT_MODE_GET_MATCH);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "ALL_MATCHES", REGIT_MODE_ALL_MATCHES);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "SPLIT", REGIT_MODE_SPLIT);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "REPLACE", REGIT_MODE_REPLACE);
|
||||
|
||||
spl_ce_RecursiveRegexIterator = register_class_RecursiveRegexIterator(spl_ce_RegexIterator, spl_ce_RecursiveIterator);
|
||||
spl_ce_RecursiveRegexIterator->create_object = spl_dual_it_new;
|
||||
|
||||
@ -3359,15 +3326,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
|
||||
spl_ce_RecursiveTreeIterator = register_class_RecursiveTreeIterator(spl_ce_RecursiveIteratorIterator);
|
||||
spl_ce_RecursiveTreeIterator->create_object = spl_RecursiveTreeIterator_new;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_CURRENT", RTIT_BYPASS_CURRENT);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_KEY", RTIT_BYPASS_KEY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "PREFIX_LEFT", 0);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "PREFIX_MID_HAS_NEXT", 1);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "PREFIX_MID_LAST", 2);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "PREFIX_END_HAS_NEXT", 3);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "PREFIX_END_LAST", 4);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "PREFIX_RIGHT", 5);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -43,6 +43,20 @@ extern PHPAPI zend_class_entry *spl_ce_SeekableIterator;
|
||||
|
||||
PHP_MINIT_FUNCTION(spl_iterators);
|
||||
|
||||
|
||||
typedef enum {
|
||||
RIT_LEAVES_ONLY = 0,
|
||||
RIT_SELF_FIRST = 1,
|
||||
RIT_CHILD_FIRST = 2
|
||||
} RecursiveIteratorMode;
|
||||
|
||||
#define RIT_CATCH_GET_CHILD CIT_CATCH_GET_CHILD
|
||||
|
||||
typedef enum {
|
||||
RTIT_BYPASS_CURRENT = 4,
|
||||
RTIT_BYPASS_KEY = 8
|
||||
} RecursiveTreeIteratorFlags;
|
||||
|
||||
typedef enum {
|
||||
DIT_Default = 0,
|
||||
DIT_FilterIterator = DIT_Default,
|
||||
|
@ -53,6 +53,27 @@ interface RecursiveIterator extends Iterator
|
||||
|
||||
class RecursiveIteratorIterator implements OuterIterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue RIT_LEAVES_ONLY
|
||||
*/
|
||||
public const LEAVES_ONLY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue RIT_SELF_FIRST
|
||||
*/
|
||||
public const SELF_FIRST = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue RIT_CHILD_FIRST
|
||||
*/
|
||||
public const CHILD_FIRST = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue RIT_CATCH_GET_CHILD
|
||||
*/
|
||||
public const CATCH_GET_CHILD = UNKNOWN;
|
||||
|
||||
public function __construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0) {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
@ -200,6 +221,37 @@ class LimitIterator extends IteratorIterator
|
||||
|
||||
class CachingIterator extends IteratorIterator implements ArrayAccess, Countable, Stringable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CIT_CALL_TOSTRING
|
||||
*/
|
||||
public const CALL_TOSTRING = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CIT_CATCH_GET_CHILD
|
||||
*/
|
||||
public const CATCH_GET_CHILD = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CIT_TOSTRING_USE_KEY
|
||||
*/
|
||||
public const TOSTRING_USE_KEY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CIT_TOSTRING_USE_CURRENT
|
||||
*/
|
||||
public const TOSTRING_USE_CURRENT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CIT_TOSTRING_USE_INNER
|
||||
*/
|
||||
public const TOSTRING_USE_INNER = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue CIT_FULL_CACHE
|
||||
*/
|
||||
public const FULL_CACHE = UNKNOWN;
|
||||
|
||||
public function __construct(Iterator $iterator, int $flags = CachingIterator::CALL_TOSTRING) {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
@ -320,6 +372,42 @@ class InfiniteIterator extends IteratorIterator
|
||||
|
||||
class RegexIterator extends FilterIterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_USE_KEY
|
||||
*/
|
||||
public const USE_KEY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_INVERTED
|
||||
*/
|
||||
public const INVERT_MATCH = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_MODE_MATCH
|
||||
*/
|
||||
public const MATCH = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_MODE_GET_MATCH
|
||||
*/
|
||||
public const GET_MATCH = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_MODE_ALL_MATCHES
|
||||
*/
|
||||
public const ALL_MATCHES = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_MODE_SPLIT
|
||||
*/
|
||||
public const SPLIT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue REGIT_MODE_REPLACE
|
||||
*/
|
||||
public const REPLACE = UNKNOWN;
|
||||
|
||||
public ?string $replacement = null;
|
||||
|
||||
public function __construct(Iterator $iterator, string $pattern, int $mode = RegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) {}
|
||||
@ -368,6 +456,29 @@ class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator
|
||||
|
||||
class RecursiveTreeIterator extends RecursiveIteratorIterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue RTIT_BYPASS_CURRENT
|
||||
*/
|
||||
public const BYPASS_CURRENT = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue RTIT_BYPASS_KEY
|
||||
*/
|
||||
public const BYPASS_KEY = UNKNOWN;
|
||||
/** @var int */
|
||||
public const PREFIX_LEFT = 0;
|
||||
/** @var int */
|
||||
public const PREFIX_MID_HAS_NEXT = 1;
|
||||
/** @var int */
|
||||
public const PREFIX_MID_LAST = 2;
|
||||
/** @var int */
|
||||
public const PREFIX_END_HAS_NEXT = 3;
|
||||
/** @var int */
|
||||
public const PREFIX_END_LAST = 4;
|
||||
/** @var int */
|
||||
public const PREFIX_RIGHT = 5;
|
||||
|
||||
/** @param RecursiveIterator|IteratorAggregate $iterator */
|
||||
public function __construct(
|
||||
$iterator,
|
||||
|
152
ext/spl/spl_iterators_arginfo.h
generated
152
ext/spl/spl_iterators_arginfo.h
generated
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: ca94fd0da2a2ed5ddd7e0a40b377ff18dd9e2ced */
|
||||
* Stub hash: c01ba2e6ccaad6db28cc6f42d679dc753be57187 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_EmptyIterator_current, 0, 0, IS_NEVER, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
@ -672,6 +672,30 @@ static zend_class_entry *register_class_RecursiveIteratorIterator(zend_class_ent
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
zend_class_implements(class_entry, 1, class_entry_OuterIterator);
|
||||
|
||||
zval const_LEAVES_ONLY_value;
|
||||
ZVAL_LONG(&const_LEAVES_ONLY_value, RIT_LEAVES_ONLY);
|
||||
zend_string *const_LEAVES_ONLY_name = zend_string_init_interned("LEAVES_ONLY", sizeof("LEAVES_ONLY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_LEAVES_ONLY_name, &const_LEAVES_ONLY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_LEAVES_ONLY_name);
|
||||
|
||||
zval const_SELF_FIRST_value;
|
||||
ZVAL_LONG(&const_SELF_FIRST_value, RIT_SELF_FIRST);
|
||||
zend_string *const_SELF_FIRST_name = zend_string_init_interned("SELF_FIRST", sizeof("SELF_FIRST") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_SELF_FIRST_name, &const_SELF_FIRST_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_SELF_FIRST_name);
|
||||
|
||||
zval const_CHILD_FIRST_value;
|
||||
ZVAL_LONG(&const_CHILD_FIRST_value, RIT_CHILD_FIRST);
|
||||
zend_string *const_CHILD_FIRST_name = zend_string_init_interned("CHILD_FIRST", sizeof("CHILD_FIRST") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CHILD_FIRST_name, &const_CHILD_FIRST_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CHILD_FIRST_name);
|
||||
|
||||
zval const_CATCH_GET_CHILD_value;
|
||||
ZVAL_LONG(&const_CATCH_GET_CHILD_value, RIT_CATCH_GET_CHILD);
|
||||
zend_string *const_CATCH_GET_CHILD_name = zend_string_init_interned("CATCH_GET_CHILD", sizeof("CATCH_GET_CHILD") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CATCH_GET_CHILD_name, &const_CATCH_GET_CHILD_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CATCH_GET_CHILD_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
@ -759,6 +783,42 @@ static zend_class_entry *register_class_CachingIterator(zend_class_entry *class_
|
||||
class_entry = zend_register_internal_class_ex(&ce, class_entry_IteratorIterator);
|
||||
zend_class_implements(class_entry, 3, class_entry_ArrayAccess, class_entry_Countable, class_entry_Stringable);
|
||||
|
||||
zval const_CALL_TOSTRING_value;
|
||||
ZVAL_LONG(&const_CALL_TOSTRING_value, CIT_CALL_TOSTRING);
|
||||
zend_string *const_CALL_TOSTRING_name = zend_string_init_interned("CALL_TOSTRING", sizeof("CALL_TOSTRING") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CALL_TOSTRING_name, &const_CALL_TOSTRING_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CALL_TOSTRING_name);
|
||||
|
||||
zval const_CATCH_GET_CHILD_value;
|
||||
ZVAL_LONG(&const_CATCH_GET_CHILD_value, CIT_CATCH_GET_CHILD);
|
||||
zend_string *const_CATCH_GET_CHILD_name = zend_string_init_interned("CATCH_GET_CHILD", sizeof("CATCH_GET_CHILD") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_CATCH_GET_CHILD_name, &const_CATCH_GET_CHILD_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_CATCH_GET_CHILD_name);
|
||||
|
||||
zval const_TOSTRING_USE_KEY_value;
|
||||
ZVAL_LONG(&const_TOSTRING_USE_KEY_value, CIT_TOSTRING_USE_KEY);
|
||||
zend_string *const_TOSTRING_USE_KEY_name = zend_string_init_interned("TOSTRING_USE_KEY", sizeof("TOSTRING_USE_KEY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_TOSTRING_USE_KEY_name, &const_TOSTRING_USE_KEY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_TOSTRING_USE_KEY_name);
|
||||
|
||||
zval const_TOSTRING_USE_CURRENT_value;
|
||||
ZVAL_LONG(&const_TOSTRING_USE_CURRENT_value, CIT_TOSTRING_USE_CURRENT);
|
||||
zend_string *const_TOSTRING_USE_CURRENT_name = zend_string_init_interned("TOSTRING_USE_CURRENT", sizeof("TOSTRING_USE_CURRENT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_TOSTRING_USE_CURRENT_name, &const_TOSTRING_USE_CURRENT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_TOSTRING_USE_CURRENT_name);
|
||||
|
||||
zval const_TOSTRING_USE_INNER_value;
|
||||
ZVAL_LONG(&const_TOSTRING_USE_INNER_value, CIT_TOSTRING_USE_INNER);
|
||||
zend_string *const_TOSTRING_USE_INNER_name = zend_string_init_interned("TOSTRING_USE_INNER", sizeof("TOSTRING_USE_INNER") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_TOSTRING_USE_INNER_name, &const_TOSTRING_USE_INNER_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_TOSTRING_USE_INNER_name);
|
||||
|
||||
zval const_FULL_CACHE_value;
|
||||
ZVAL_LONG(&const_FULL_CACHE_value, CIT_FULL_CACHE);
|
||||
zend_string *const_FULL_CACHE_name = zend_string_init_interned("FULL_CACHE", sizeof("FULL_CACHE") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_FULL_CACHE_name, &const_FULL_CACHE_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_FULL_CACHE_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
||||
@ -810,6 +870,48 @@ static zend_class_entry *register_class_RegexIterator(zend_class_entry *class_en
|
||||
INIT_CLASS_ENTRY(ce, "RegexIterator", class_RegexIterator_methods);
|
||||
class_entry = zend_register_internal_class_ex(&ce, class_entry_FilterIterator);
|
||||
|
||||
zval const_USE_KEY_value;
|
||||
ZVAL_LONG(&const_USE_KEY_value, REGIT_USE_KEY);
|
||||
zend_string *const_USE_KEY_name = zend_string_init_interned("USE_KEY", sizeof("USE_KEY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_USE_KEY_name, &const_USE_KEY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_USE_KEY_name);
|
||||
|
||||
zval const_INVERT_MATCH_value;
|
||||
ZVAL_LONG(&const_INVERT_MATCH_value, REGIT_INVERTED);
|
||||
zend_string *const_INVERT_MATCH_name = zend_string_init_interned("INVERT_MATCH", sizeof("INVERT_MATCH") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_INVERT_MATCH_name, &const_INVERT_MATCH_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_INVERT_MATCH_name);
|
||||
|
||||
zval const_MATCH_value;
|
||||
ZVAL_LONG(&const_MATCH_value, REGIT_MODE_MATCH);
|
||||
zend_string *const_MATCH_name = zend_string_init_interned("MATCH", sizeof("MATCH") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_MATCH_name, &const_MATCH_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_MATCH_name);
|
||||
|
||||
zval const_GET_MATCH_value;
|
||||
ZVAL_LONG(&const_GET_MATCH_value, REGIT_MODE_GET_MATCH);
|
||||
zend_string *const_GET_MATCH_name = zend_string_init_interned("GET_MATCH", sizeof("GET_MATCH") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_GET_MATCH_name, &const_GET_MATCH_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_GET_MATCH_name);
|
||||
|
||||
zval const_ALL_MATCHES_value;
|
||||
ZVAL_LONG(&const_ALL_MATCHES_value, REGIT_MODE_ALL_MATCHES);
|
||||
zend_string *const_ALL_MATCHES_name = zend_string_init_interned("ALL_MATCHES", sizeof("ALL_MATCHES") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_ALL_MATCHES_name, &const_ALL_MATCHES_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_ALL_MATCHES_name);
|
||||
|
||||
zval const_SPLIT_value;
|
||||
ZVAL_LONG(&const_SPLIT_value, REGIT_MODE_SPLIT);
|
||||
zend_string *const_SPLIT_name = zend_string_init_interned("SPLIT", sizeof("SPLIT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_SPLIT_name, &const_SPLIT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_SPLIT_name);
|
||||
|
||||
zval const_REPLACE_value;
|
||||
ZVAL_LONG(&const_REPLACE_value, REGIT_MODE_REPLACE);
|
||||
zend_string *const_REPLACE_name = zend_string_init_interned("REPLACE", sizeof("REPLACE") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_REPLACE_name, &const_REPLACE_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_REPLACE_name);
|
||||
|
||||
zval property_replacement_default_value;
|
||||
ZVAL_NULL(&property_replacement_default_value);
|
||||
zend_string *property_replacement_name = zend_string_init("replacement", sizeof("replacement") - 1, 1);
|
||||
@ -837,5 +939,53 @@ static zend_class_entry *register_class_RecursiveTreeIterator(zend_class_entry *
|
||||
INIT_CLASS_ENTRY(ce, "RecursiveTreeIterator", class_RecursiveTreeIterator_methods);
|
||||
class_entry = zend_register_internal_class_ex(&ce, class_entry_RecursiveIteratorIterator);
|
||||
|
||||
zval const_BYPASS_CURRENT_value;
|
||||
ZVAL_LONG(&const_BYPASS_CURRENT_value, RTIT_BYPASS_CURRENT);
|
||||
zend_string *const_BYPASS_CURRENT_name = zend_string_init_interned("BYPASS_CURRENT", sizeof("BYPASS_CURRENT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_BYPASS_CURRENT_name, &const_BYPASS_CURRENT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_BYPASS_CURRENT_name);
|
||||
|
||||
zval const_BYPASS_KEY_value;
|
||||
ZVAL_LONG(&const_BYPASS_KEY_value, RTIT_BYPASS_KEY);
|
||||
zend_string *const_BYPASS_KEY_name = zend_string_init_interned("BYPASS_KEY", sizeof("BYPASS_KEY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_BYPASS_KEY_name, &const_BYPASS_KEY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_BYPASS_KEY_name);
|
||||
|
||||
zval const_PREFIX_LEFT_value;
|
||||
ZVAL_LONG(&const_PREFIX_LEFT_value, 0);
|
||||
zend_string *const_PREFIX_LEFT_name = zend_string_init_interned("PREFIX_LEFT", sizeof("PREFIX_LEFT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_PREFIX_LEFT_name, &const_PREFIX_LEFT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_PREFIX_LEFT_name);
|
||||
|
||||
zval const_PREFIX_MID_HAS_NEXT_value;
|
||||
ZVAL_LONG(&const_PREFIX_MID_HAS_NEXT_value, 1);
|
||||
zend_string *const_PREFIX_MID_HAS_NEXT_name = zend_string_init_interned("PREFIX_MID_HAS_NEXT", sizeof("PREFIX_MID_HAS_NEXT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_PREFIX_MID_HAS_NEXT_name, &const_PREFIX_MID_HAS_NEXT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_PREFIX_MID_HAS_NEXT_name);
|
||||
|
||||
zval const_PREFIX_MID_LAST_value;
|
||||
ZVAL_LONG(&const_PREFIX_MID_LAST_value, 2);
|
||||
zend_string *const_PREFIX_MID_LAST_name = zend_string_init_interned("PREFIX_MID_LAST", sizeof("PREFIX_MID_LAST") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_PREFIX_MID_LAST_name, &const_PREFIX_MID_LAST_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_PREFIX_MID_LAST_name);
|
||||
|
||||
zval const_PREFIX_END_HAS_NEXT_value;
|
||||
ZVAL_LONG(&const_PREFIX_END_HAS_NEXT_value, 3);
|
||||
zend_string *const_PREFIX_END_HAS_NEXT_name = zend_string_init_interned("PREFIX_END_HAS_NEXT", sizeof("PREFIX_END_HAS_NEXT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_PREFIX_END_HAS_NEXT_name, &const_PREFIX_END_HAS_NEXT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_PREFIX_END_HAS_NEXT_name);
|
||||
|
||||
zval const_PREFIX_END_LAST_value;
|
||||
ZVAL_LONG(&const_PREFIX_END_LAST_value, 4);
|
||||
zend_string *const_PREFIX_END_LAST_name = zend_string_init_interned("PREFIX_END_LAST", sizeof("PREFIX_END_LAST") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_PREFIX_END_LAST_name, &const_PREFIX_END_LAST_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_PREFIX_END_LAST_name);
|
||||
|
||||
zval const_PREFIX_RIGHT_value;
|
||||
ZVAL_LONG(&const_PREFIX_RIGHT_value, 5);
|
||||
zend_string *const_PREFIX_RIGHT_name = zend_string_init_interned("PREFIX_RIGHT", sizeof("PREFIX_RIGHT") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_PREFIX_RIGHT_name, &const_PREFIX_RIGHT_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_PREFIX_RIGHT_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
@ -1015,13 +1015,6 @@ PHP_METHOD(SplObjectStorage, __debugInfo)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
typedef enum {
|
||||
MIT_NEED_ANY = 0,
|
||||
MIT_NEED_ALL = 1,
|
||||
MIT_KEYS_NUMERIC = 0,
|
||||
MIT_KEYS_ASSOC = 2
|
||||
} MultipleIteratorFlags;
|
||||
|
||||
#define SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT 1
|
||||
#define SPL_MULTIPLE_ITERATOR_GET_ALL_KEY 2
|
||||
|
||||
@ -1352,11 +1345,6 @@ PHP_MINIT_FUNCTION(spl_observer)
|
||||
spl_ce_MultipleIterator = register_class_MultipleIterator(zend_ce_iterator);
|
||||
spl_ce_MultipleIterator->create_object = spl_SplObjectStorage_new;
|
||||
|
||||
REGISTER_SPL_CLASS_CONST_LONG(MultipleIterator, "MIT_NEED_ANY", MIT_NEED_ANY);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(MultipleIterator, "MIT_NEED_ALL", MIT_NEED_ALL);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(MultipleIterator, "MIT_KEYS_NUMERIC", MIT_KEYS_NUMERIC);
|
||||
REGISTER_SPL_CLASS_CONST_LONG(MultipleIterator, "MIT_KEYS_ASSOC", MIT_KEYS_ASSOC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -20,6 +20,13 @@
|
||||
#include "php.h"
|
||||
#include "php_spl.h"
|
||||
|
||||
typedef enum {
|
||||
MIT_NEED_ANY = 0,
|
||||
MIT_NEED_ALL = 1,
|
||||
MIT_KEYS_NUMERIC = 0,
|
||||
MIT_KEYS_ASSOC = 2
|
||||
} MultipleIteratorFlags;
|
||||
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplObserver;
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplSubject;
|
||||
extern PHPAPI zend_class_entry *spl_ce_SplObjectStorage;
|
||||
|
@ -115,6 +115,27 @@ class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
|
||||
|
||||
class MultipleIterator implements Iterator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue MIT_NEED_ANY
|
||||
*/
|
||||
public const MIT_NEED_ANY = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue MIT_NEED_ALL
|
||||
*/
|
||||
public const MIT_NEED_ALL = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue MIT_KEYS_NUMERIC
|
||||
*/
|
||||
public const MIT_KEYS_NUMERIC = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue MIT_KEYS_ASSOC
|
||||
*/
|
||||
public const MIT_KEYS_ASSOC = UNKNOWN;
|
||||
|
||||
public function __construct(int $flags = MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC) {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
|
26
ext/spl/spl_observer_arginfo.h
generated
26
ext/spl/spl_observer_arginfo.h
generated
@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 63dde3294f600164805befd79b1f670fbfb23571 */
|
||||
* Stub hash: e2d66473e8e2436652b78abd9c237e1a50c3d0dc */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplObserver_update, 0, 1, IS_VOID, 0)
|
||||
ZEND_ARG_OBJ_INFO(0, subject, SplSubject, 0)
|
||||
@ -268,5 +268,29 @@ static zend_class_entry *register_class_MultipleIterator(zend_class_entry *class
|
||||
class_entry = zend_register_internal_class_ex(&ce, NULL);
|
||||
zend_class_implements(class_entry, 1, class_entry_Iterator);
|
||||
|
||||
zval const_MIT_NEED_ANY_value;
|
||||
ZVAL_LONG(&const_MIT_NEED_ANY_value, MIT_NEED_ANY);
|
||||
zend_string *const_MIT_NEED_ANY_name = zend_string_init_interned("MIT_NEED_ANY", sizeof("MIT_NEED_ANY") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_MIT_NEED_ANY_name, &const_MIT_NEED_ANY_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_MIT_NEED_ANY_name);
|
||||
|
||||
zval const_MIT_NEED_ALL_value;
|
||||
ZVAL_LONG(&const_MIT_NEED_ALL_value, MIT_NEED_ALL);
|
||||
zend_string *const_MIT_NEED_ALL_name = zend_string_init_interned("MIT_NEED_ALL", sizeof("MIT_NEED_ALL") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_MIT_NEED_ALL_name, &const_MIT_NEED_ALL_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_MIT_NEED_ALL_name);
|
||||
|
||||
zval const_MIT_KEYS_NUMERIC_value;
|
||||
ZVAL_LONG(&const_MIT_KEYS_NUMERIC_value, MIT_KEYS_NUMERIC);
|
||||
zend_string *const_MIT_KEYS_NUMERIC_name = zend_string_init_interned("MIT_KEYS_NUMERIC", sizeof("MIT_KEYS_NUMERIC") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_MIT_KEYS_NUMERIC_name, &const_MIT_KEYS_NUMERIC_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_MIT_KEYS_NUMERIC_name);
|
||||
|
||||
zval const_MIT_KEYS_ASSOC_value;
|
||||
ZVAL_LONG(&const_MIT_KEYS_ASSOC_value, MIT_KEYS_ASSOC);
|
||||
zend_string *const_MIT_KEYS_ASSOC_name = zend_string_init_interned("MIT_KEYS_ASSOC", sizeof("MIT_KEYS_ASSOC") - 1, 1);
|
||||
zend_declare_class_constant_ex(class_entry, const_MIT_KEYS_ASSOC_name, &const_MIT_KEYS_ASSOC_value, ZEND_ACC_PUBLIC, NULL);
|
||||
zend_string_release(const_MIT_KEYS_ASSOC_name);
|
||||
|
||||
return class_entry;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user