= PHP_5_4_0, PHP_7, PHP_8 // iterator_apply() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // iterator_count() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // iterator_to_array() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_autoload_call() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_autoload_extensions() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_autoload_functions() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_autoload_register() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_autoload_unregister() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_autoload() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // spl_classes() - PHP_5, PHP_7, PHP_8 // spl_object_hash() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // OFFLINE | spl_object_id() - PHP_7 >= PHP_7_2_0, PHP_8 // ============================== USING CLASSES (36) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLMAXHEAP - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLMINHEAP - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY - PHP_5 - PHP_8 // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR - PHP_5 - PHP_8 // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO - PHP_5 - PHP_8 // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT - PHP_5 - PHP_8 // PHP_BASIC_SPL_FILEHANDLING_SPLTEMPFILEOBJECT - PHP_5 - PHP_8 // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT - PHP_5 - PHP_8 // ============================== USING DATA_TYPES (53) // array // false // object // string // bool // int // Traversable - PHP_5, PHP_7, PHP_8 // callable // void // SplDoublyLinkedList - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // mixed // SplQueue - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplMaxHeap - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplMinHeap - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFixedArray - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // SplObjectStorage - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayIterator - PHP_5, PHP_7, PHP_8 // scalar // null // CachingIterator - PHP_5, PHP_7, PHP_8 // CallbackFilterIterator - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // DirectoryIterator - PHP_5, PHP_7, PHP_8 // never // EmptyIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilesystemIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFileInfo - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // FilterIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // GlobIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // InfiniteIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // MultipleIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // NoRewindIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ParentIterator - PHP_5 >= PHP_5_1_0, PHP 7, PHP 8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveArrayIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveCachingIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveCallbackFilterIterator - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // RecursiveDirectoryIterator - PHP_5, PHP_7, PHP_8 // RecursiveFilterIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator - PHP_5, PHP_7, PHP_8 // RecursiveRegexIterator - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RecursiveTreeIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // IteratorAggregate - PHP_5, PHP_7, PHP_8 // RegexIterator - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // SplFileObject - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // resource // SplTempFileObject - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ArrayObject - PHP_5, PHP_7, PHP_8 // ============================== END // REQUIREMENTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL // ============================== ABOUT // PHP Manual / Function Reference / Other Basic Extensions / SPL - Standard PHP Library (SPL) // URL: https://www.php.net/manual/en/book.spl.php // ============================== DESCRIPTION // STANDARD_PHP_LIBRARY_SPL // LANGUAGE_REFERENCE_PREDEFINED_INTERFACES_AND_CLASSES // LANGUAGE_REFERENCE_PREDEFINED_EXCEPTIONS // LANGUAGE_REFERENCE_FIBERS // // STANDARD_PHP_LIBRARY_SPL - BEGIN // Standard PHP Library (SPL) // // INTRODUCTION // INSTALLING_CONFIGURING // PREDEFINED_CONSTANTS // DATASTRUCTURES // ITERATORS // INTERFACES // EXCEPTIONS // SPL_FUNCTIONS // FILE_HANDLING // MISCELLANEOUS_CLASSES_AND_INTERFACES // // INTRODUCTION - BEGIN // Introduction // // The Standard PHP Library (SPL) is a collection of interfaces and classes that are meant to solve common problems. // SPL provides a set of standard datastructure, a set of iterators to traverse over objects, a set of interfaces, a set of standard Exceptions, a number of classes to work with files and it provides a set of functions like spl_autoload_register() // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/intro.spl.php // INTRODUCTION - END // // INSTALLING_CONFIGURING - BEGIN // Installing/Configuring // // REQUIREMENTS // INSTALLATION // RUNTIME_CONFIGURATION // RESOURCE_TYPES // // REQUIREMENTS - BEGIN // Requirements // // No external libraries are needed to build this extension. // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.requirements.php // REQUIREMENTS - END // // INSTALLATION - BEGIN // Installation // // There is no installation needed to use these functions; they are part of the PHP core. // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.installation.php // INSTALLATION - END // // RUNTIME_CONFIGURATION - BEGIN // Runtime Configuration // // This extension has no configuration directives defined in php.ini. // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.configuration.php // RUNTIME_CONFIGURATION - END // // RESOURCE_TYPES - BEGIN // Resource Types // // This extension has no resource types defined. // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.resources.php // RESOURCE_TYPES - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.setup.php // INSTALLING_CONFIGURING - END // // PREDEFINED_CONSTANTS - BEGIN // Predefined Constants // // The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.constants.php // PREDEFINED_CONSTANTS - END // // DATASTRUCTURES - BEGIN // Datastructures // // THE_SPLDOUBLYLINKEDLIST_CLASS // THE_SPLSTACK_CLASS // THE_SPLQUEUE_CLASS // THE_SPLHEAP_CLASS // THE_SPLMAXHEAP_CLASS // THE_SPLMINHEAP_CLASS // THE_SPLPRIORITYQUEUE_CLASS // THE_SPLFIXEDARRAY_CLASS // THE_SPLOBJECTSTORAGE_CLASS // // SPL provides a set of standard datastructures. They are grouped here by their underlying implementation which usually defines their general field of application. // // Doubly Linked Lists // A Doubly Linked List (DLL) is a list of nodes linked in both directions to each other. Iterator's operations, access to both ends, addition or removal of nodes have a cost of O(1) when the underlying structure is a DLL. It hence provides a decent implementation for stacks and queues. // * SplDoublyLinkedList // * SplStack // * SplQueue // // Heaps // Heaps are tree-like structures that follow the heap-property: each node is greater than or equal to its children, when compared using the implemented compare method which is global to the heap. // * SplHeap // * SplMaxHeap // * SplMinHeap // * SplPriorityQueue // // Arrays // Arrays are structures that store the data in a continuous way, accessible via indexes. Don't confuse them with PHP arrays: PHP arrays are in fact implemented as ordered hashtables. // * SplFixedArray // // Map // A map is a datastructure holding key-value pairs. PHP arrays can be seen as maps from integers/strings to values. SPL provides a map from objects to data. This map can also be used as an object set. // * SplObjectStorage // // THE_SPLDOUBLYLINKEDLIST_CLASS - BEGIN // The SplDoublyLinkedList class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplDoublyLinkedList class provides the main functionalities of a doubly linked list. // // Class synopsis // [code] // class SplDoublyLinkedList implements Iterator, Countable, ArrayAccess, Serializable { // // /* Constants */ // public const int IT_MODE_LIFO; // public const int IT_MODE_FIFO; // public const int IT_MODE_DELETE; // public const int IT_MODE_KEEP; // // /* Methods */ // public add(int $index, mixed $value): void // public bottom(): mixed // public count(): int // public current(): mixed // public getIteratorMode(): int // public isEmpty(): bool // public key(): int // public next(): void // public offsetExists(int $index): bool // public offsetGet(int $index): mixed // public offsetSet(?int $index, mixed $value): void // public offsetUnset(int $index): void // public pop(): mixed // public prev(): void // public push(mixed $value): void // public rewind(): void // public serialize(): string // public setIteratorMode(int $mode): int // public shift(): mixed // public top(): mixed // public unserialize(string $data): void // public unshift(mixed $value): void // public valid(): bool // } // [/code] // // Predefined Constants // Iteration Direction // SplDoublyLinkedList::IT_MODE_LIFO - The list will be iterated in a last in, first out order, like a stack. // SplDoublyLinkedList::IT_MODE_FIFO - The list will be iterated in a first in, first out order, like a queue. // Iteration Behavior // SplDoublyLinkedList::IT_MODE_DELETE - Iteration will remove the iterated elements. // SplDoublyLinkedList::IT_MODE_KEEP - Iteration will not remove the iterated elements. // // Table of Contents // * SplDoublyLinkedList::add - Add/insert a new value at the specified index // * SplDoublyLinkedList::bottom - Peeks at the node from the beginning of the doubly linked list // * SplDoublyLinkedList::count - Counts the number of elements in the doubly linked list // * SplDoublyLinkedList::current - Return current array entry // * SplDoublyLinkedList::getIteratorMode - Returns the mode of iteration // * SplDoublyLinkedList::isEmpty - Checks whether the doubly linked list is empty // * SplDoublyLinkedList::key - Return current node index // * SplDoublyLinkedList::next - Move to next entry // * SplDoublyLinkedList::offsetExists - Returns whether the requested $index exists // * SplDoublyLinkedList::offsetGet - Returns the value at the specified $index // * SplDoublyLinkedList::offsetSet - Sets the value at the specified $index to $value // * SplDoublyLinkedList::offsetUnset - Unsets the value at the specified $index // * SplDoublyLinkedList::pop - Pops a node from the end of the doubly linked list // * SplDoublyLinkedList::prev - Move to previous entry // * SplDoublyLinkedList::push - Pushes an element at the end of the doubly linked list // * SplDoublyLinkedList::rewind - Rewind iterator back to the start // * SplDoublyLinkedList::serialize - Serializes the storage // * SplDoublyLinkedList::setIteratorMode - Sets the mode of iteration // * SplDoublyLinkedList::shift - Shifts a node from the beginning of the doubly linked list // * SplDoublyLinkedList::top - Peeks at the node from the end of the doubly linked list // * SplDoublyLinkedList::unserialize - Unserializes the storage // * SplDoublyLinkedList::unshift - Prepends the doubly linked list with an element // * SplDoublyLinkedList::valid - Check whether the doubly linked list contains more nodes // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.spldoublylinkedlist.php // THE_SPLDOUBLYLINKEDLIST_CLASS - END // // THE_SPLSTACK_CLASS - BEGIN // The SplStack class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplStack class provides the main functionalities of a stack implemented using a doubly linked list by setting the iterator mode to SplDoublyLinkedList::IT_MODE_LIFO. // // Class synopsis // [code] // class SplStack extends SplDoublyLinkedList { // // /* Inherited constants */ // public const int SplDoublyLinkedList::IT_MODE_LIFO; // public const int SplDoublyLinkedList::IT_MODE_FIFO; // public const int SplDoublyLinkedList::IT_MODE_DELETE; // public const int SplDoublyLinkedList::IT_MODE_KEEP; // // /* Inherited methods */ // public SplDoublyLinkedList::add(int $index, mixed $value): void // public SplDoublyLinkedList::bottom(): mixed // public SplDoublyLinkedList::count(): int // public SplDoublyLinkedList::current(): mixed // public SplDoublyLinkedList::getIteratorMode(): int // public SplDoublyLinkedList::isEmpty(): bool // public SplDoublyLinkedList::key(): int // public SplDoublyLinkedList::next(): void // public SplDoublyLinkedList::offsetExists(int $index): bool // public SplDoublyLinkedList::offsetGet(int $index): mixed // public SplDoublyLinkedList::offsetSet(?int $index, mixed $value): void // public SplDoublyLinkedList::offsetUnset(int $index): void // public SplDoublyLinkedList::pop(): mixed // public SplDoublyLinkedList::prev(): void // public SplDoublyLinkedList::push(mixed $value): void // public SplDoublyLinkedList::rewind(): void // public SplDoublyLinkedList::serialize(): string // public SplDoublyLinkedList::setIteratorMode(int $mode): int // public SplDoublyLinkedList::shift(): mixed // public SplDoublyLinkedList::top(): mixed // public SplDoublyLinkedList::unserialize(string $data): void // public SplDoublyLinkedList::unshift(mixed $value): void // public SplDoublyLinkedList::valid(): bool // } // [/code] // // [examples] // Examples // [example] // Example #1 SplStack example // [php] // $q = new SplStack(); // $q[] = 1; // $q[] = 2; // $q[] = 3; // foreach ($q as $elem) { // echo $elem."\n"; // } // [/php] // The above example will output: // [result] // 3 // 2 // 1 // [/result] // [/example] // [/examples] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splstack.php // THE_SPLSTACK_CLASS - END // // THE_SPLQUEUE_CLASS - BEGIN // The SplQueue class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplQueue class provides the main functionalities of a queue implemented using a doubly linked list by setting the iterator mode to SplDoublyLinkedList::IT_MODE_FIFO. // // Class synopsis // [code] // class SplQueue extends SplDoublyLinkedList { // // /* Inherited constants */ // public const int SplDoublyLinkedList::IT_MODE_LIFO; // public const int SplDoublyLinkedList::IT_MODE_FIFO; // public const int SplDoublyLinkedList::IT_MODE_DELETE; // public const int SplDoublyLinkedList::IT_MODE_KEEP; // // /* Methods */ // public dequeue(): mixed // public enqueue(mixed $value): void // // /* Inherited methods */ // public SplDoublyLinkedList::add(int $index, mixed $value): void // public SplDoublyLinkedList::bottom(): mixed // public SplDoublyLinkedList::count(): int // public SplDoublyLinkedList::current(): mixed // public SplDoublyLinkedList::getIteratorMode(): int // public SplDoublyLinkedList::isEmpty(): bool // public SplDoublyLinkedList::key(): int // public SplDoublyLinkedList::next(): void // public SplDoublyLinkedList::offsetExists(int $index): bool // public SplDoublyLinkedList::offsetGet(int $index): mixed // public SplDoublyLinkedList::offsetSet(?int $index, mixed $value): void // public SplDoublyLinkedList::offsetUnset(int $index): void // public SplDoublyLinkedList::pop(): mixed // public SplDoublyLinkedList::prev(): void // public SplDoublyLinkedList::push(mixed $value): void // public SplDoublyLinkedList::rewind(): void // public SplDoublyLinkedList::serialize(): string // public SplDoublyLinkedList::setIteratorMode(int $mode): int // public SplDoublyLinkedList::shift(): mixed // public SplDoublyLinkedList::top(): mixed // public SplDoublyLinkedList::unserialize(string $data): void // public SplDoublyLinkedList::unshift(mixed $value): void // public SplDoublyLinkedList::valid(): bool // } // [/code] // // [examples] // Examples // [example] // Example #1 SplQueue example // [php] // $q = new SplQueue(); // $q[] = 1; // $q[] = 2; // $q[] = 3; // foreach ($q as $elem) { // echo $elem."\n"; // } // [/php] // The above example will output: // [result] // 1 // 2 // 3 // [/result] // [/example] // [example] // Example #2 Efficiently handling tasks with SplQueue // [php] // $q = new SplQueue(); // $q->setIteratorMode(SplQueue::IT_MODE_DELETE); // // ... enqueue some tasks on the queue ... // // process them // foreach ($q as $task) { // // ... process $task ... // // add new tasks on the queue // $q[] = $newTask; // // ... // } // [/php] // [/example] // [/examples] // // Table of Contents // * SplQueue::dequeue - Dequeues a node from the queue // * SplQueue::enqueue - Adds an element to the queue // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splqueue.php // THE_SPLQUEUE_CLASS - END // // THE_SPLHEAP_CLASS - BEGIN // The SplHeap class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplHeap class provides the main functionalities of a Heap. // // Class synopsis // [code] // abstract class SplHeap implements Iterator, Countable { // // /* Methods */ // protected compare(mixed $value1, mixed $value2): int // public count(): int // public current(): mixed // public extract(): mixed // public insert(mixed $value): true // public isCorrupted(): bool // public isEmpty(): bool // public key(): int // public next(): void // public recoverFromCorruption(): bool // public rewind(): void // public top(): mixed // public valid(): bool // } // [/code] // // Table of Contents // * SplHeap::compare - Compare elements in order to place them correctly in the heap while sifting up // * SplHeap::count - Counts the number of elements in the heap // * SplHeap::current - Return current node pointed by the iterator // * SplHeap::extract - Extracts a node from top of the heap and sift up // * SplHeap::insert - Inserts an element in the heap by sifting it up // * SplHeap::isCorrupted - Tells if the heap is in a corrupted state // * SplHeap::isEmpty - Checks whether the heap is empty // * SplHeap::key - Return current node index // * SplHeap::next - Move to the next node // * SplHeap::recoverFromCorruption - Recover from the corrupted state and allow further actions on the heap // * SplHeap::rewind - Rewind iterator back to the start (no-op) // * SplHeap::top - Peeks at the node from the top of the heap // * SplHeap::valid - Check whether the heap contains more nodes // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splheap.php // THE_SPLHEAP_CLASS - END // // THE_SPLMAXHEAP_CLASS - BEGIN // The SplMaxHeap class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplMaxHeap class provides the main functionalities of a heap, keeping the maximum on the top. // // Class synopsis // [code] // class SplMaxHeap extends SplHeap { // // /* Methods */ // protected compare(mixed $value1, mixed $value2): int // // /* Inherited methods */ // protected SplHeap::compare(mixed $value1, mixed $value2): int // public SplHeap::count(): int // public SplHeap::current(): mixed // public SplHeap::extract(): mixed // public SplHeap::insert(mixed $value): true // public SplHeap::isCorrupted(): bool // public SplHeap::isEmpty(): bool // public SplHeap::key(): int // public SplHeap::next(): void // public SplHeap::recoverFromCorruption(): bool // public SplHeap::rewind(): void // public SplHeap::top(): mixed // public SplHeap::valid(): bool // } // [/code] // // Table of Contents // * SplMaxHeap::compare - Compare elements in order to place them correctly in the heap while sifting up // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splmaxheap.php // THE_SPLMAXHEAP_CLASS - END // // THE_SPLMINHEAP_CLASS - BEGIN // The SplMinHeap class // // SPLMINHEAP_COMPARE // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplMinHeap class provides the main functionalities of a heap, keeping the minimum on the top. // // Class synopsis // [code] // class SplMinHeap extends SplHeap { // // /* Methods */ // protected compare(mixed $value1, mixed $value2): int // // /* Inherited methods */ // protected SplHeap::compare(mixed $value1, mixed $value2): int // public SplHeap::count(): int // public SplHeap::current(): mixed // public SplHeap::extract(): mixed // public SplHeap::insert(mixed $value): true // public SplHeap::isCorrupted(): bool // public SplHeap::isEmpty(): bool // public SplHeap::key(): int // public SplHeap::next(): void // public SplHeap::recoverFromCorruption(): bool // public SplHeap::rewind(): void // public SplHeap::top(): mixed // public SplHeap::valid(): bool // } // [/code] // // Table of Contents // * SplMinHeap::compare - Compare elements in order to place them correctly in the heap while sifting up // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splminheap.php // THE_SPLMINHEAP_CLASS - END // // THE_SPLPRIORITYQUEUE_CLASS - BEGIN // The SplPriorityQueue class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplPriorityQueue class provides the main functionalities of a prioritized queue, implemented using a max heap. // Note: The order of elements with identical priority is undefined. It may differ from the order in which they have been inserted. // // Class synopsis // [code] // class SplPriorityQueue implements Iterator, Countable { // // /* Constants */ // public const int EXTR_BOTH; // public const int EXTR_PRIORITY; // public const int EXTR_DATA; // // /* Methods */ // public compare(mixed $priority1, mixed $priority2): int // public count(): int // public current(): mixed // public extract(): mixed // public getExtractFlags(): int // public insert(mixed $value, mixed $priority): true // public isCorrupted(): bool // public isEmpty(): bool // public key(): int // public next(): void // public recoverFromCorruption(): bool // public rewind(): void // public setExtractFlags(int $flags): int // public top(): mixed // public valid(): bool // } // [/code] // // Predefined Constants // SplPriorityQueue::EXTR_BOTH // SplPriorityQueue::EXTR_PRIORITY // SplPriorityQueue::EXTR_DATA // // Table of Contents // * SplPriorityQueue::compare - Compare priorities in order to place elements correctly in the heap while sifting up // * SplPriorityQueue::count - Counts the number of elements in the queue // * SplPriorityQueue::current - Return current node pointed by the iterator // * SplPriorityQueue::extract - Extracts a node from top of the heap and sift up // * SplPriorityQueue::getExtractFlags - Get the flags of extraction // * SplPriorityQueue::insert - Inserts an element in the queue by sifting it up // * SplPriorityQueue::isCorrupted - Tells if the priority queue is in a corrupted state // * SplPriorityQueue::isEmpty - Checks whether the queue is empty // * SplPriorityQueue::key - Return current node index // * SplPriorityQueue::next - Move to the next node // * SplPriorityQueue::recoverFromCorruption - Recover from the corrupted state and allow further actions on the queue // * SplPriorityQueue::rewind - Rewind iterator back to the start (no-op) // * SplPriorityQueue::setExtractFlags - Sets the mode of extraction // * SplPriorityQueue::top - Peeks at the node from the top of the queue // * SplPriorityQueue::valid - Check whether the queue contains more nodes // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splpriorityqueue.php // THE_SPLPRIORITYQUEUE_CLASS - END // // THE_SPLFIXEDARRAY_CLASS - BEGIN // The SplFixedArray class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The SplFixedArray class provides the main functionalities of array. The main difference between a SplFixedArray and a normal PHP array is that the SplFixedArray must be resized manually and allows only integers within the range as indexes. The advantage is that it uses less memory than a standard array. // // Class synopsis // [code] // class SplFixedArray implements IteratorAggregate, ArrayAccess, Countable, JsonSerializable { // // /* Methods */ // public __construct(int $size = 0) // public count(): int // public current(): mixed // public static fromArray(array $array, bool $preserveKeys = true): SplFixedArray // public getIterator(): Iterator // public getSize(): int // public jsonSerialize(): mixed // public key(): int // public next(): void // public offsetExists(int $index): bool // public offsetGet(int $index): mixed // public offsetSet(int $index, mixed $value): void // public offsetUnset(int $index): void // public rewind(): void // public __serialize(): array // public setSize(int $size): bool // public toArray(): array // public __unserialize(array $data): void // public valid(): bool // public __wakeup(): void // } // [/code] // // Changelog // Version - Description // 8.2.0 - The SplFixedArray::__serialize() and SplFixedArray::__unserialize() magic methods have been added to SplFixedArray. // 8.1.0 - SplFixedArray implements JsonSerializable now. // 8.0.0 - SplFixedArray implements IteratorAggregate now. Previously, Iterator was implemented instead. // // [examples] // Examples // [example] // Example #1 SplFixedArray usage example // [php] // // Initialize the array with a fixed length // $array = new SplFixedArray(5); // // $array[1] = 2; // $array[4] = "foo"; // // var_dump($array[0]); // NULL // var_dump($array[1]); // int(2) // // var_dump($array["4"]); // string(3) "foo" // // // Increase the size of the array to 10 // $array->setSize(10); // // $array[9] = "asdf"; // // // Shrink the array to a size of 2 // $array->setSize(2); // // // The following lines throw a RuntimeException: Index invalid or out of range // try { // var_dump($array["non-numeric"]); // } catch(RuntimeException $re) { // echo "RuntimeException: ".$re->getMessage()."\n"; // } // // try { // var_dump($array[-1]); // } catch(RuntimeException $re) { // echo "RuntimeException: ".$re->getMessage()."\n"; // } // // try { // var_dump($array[5]); // } catch(RuntimeException $re) { // echo "RuntimeException: ".$re->getMessage()."\n"; // } // [/php] // The above example will output: // [result] // NULL // int(2) // string(3) "foo" // RuntimeException: Index invalid or out of range // RuntimeException: Index invalid or out of range // RuntimeException: Index invalid or out of range // [/result] // [/example] // [/examples] // // Table of Contents // * SplFixedArray::__construct - Constructs a new fixed array // * SplFixedArray::count - Returns the size of the array // * SplFixedArray::current - Return current array entry // * SplFixedArray::fromArray - Import a PHP array in a SplFixedArray instance // * SplFixedArray::getIterator - Retrieve the iterator to go through the array // * SplFixedArray::getSize - Gets the size of the array // * SplFixedArray::jsonSerialize - Returns a representation that can be converted to JSON // * SplFixedArray::key - Return current array index // * SplFixedArray::next - Move to next entry // * SplFixedArray::offsetExists - Returns whether the requested index exists // * SplFixedArray::offsetGet - Returns the value at the specified index // * SplFixedArray::offsetSet - Sets a new value at a specified index // * SplFixedArray::offsetUnset - Unsets the value at the specified $index // * SplFixedArray::rewind - Rewind iterator back to the start // * SplFixedArray::__serialize - Serializes the SplFixedArray object // * SplFixedArray::setSize - Change the size of an array // * SplFixedArray::toArray - Returns a PHP array from the fixed array // * SplFixedArray::__unserialize - Deserializes the data parameter into an SplFixedArray object // * SplFixedArray::valid - Check whether the array contains more elements // * SplFixedArray::__wakeup - Reinitialises the array after being unserialised // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splfixedarray.php // THE_SPLFIXEDARRAY_CLASS - END // // THE_SPLOBJECTSTORAGE_CLASS - BEGIN // The SplObjectStorage class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The SplObjectStorage class provides a map from objects to data or, by ignoring data, an object set. This dual purpose can be useful in many cases involving the need to uniquely identify objects. // // Class synopsis // [code] // class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess { // // /* Methods */ // public addAll(SplObjectStorage $storage): int // public attach(object $object, mixed $info = null): void // public contains(object $object): bool // public count(int $mode = COUNT_NORMAL): int // public current(): object // public detach(object $object): void // public getHash(object $object): string // public getInfo(): mixed // public key(): int // public next(): void // public offsetExists(object $object): bool // public offsetGet(object $object): mixed // public offsetSet(object $object, mixed $info = null): void // public offsetUnset(object $object): void // public removeAll(SplObjectStorage $storage): int // public removeAllExcept(SplObjectStorage $storage): int // public rewind(): void // public serialize(): string // public setInfo(mixed $info): void // public unserialize(string $data): void // public valid(): bool // } // [/code] // // [examples] // Examples // [example] // Example #1 SplObjectStorage as a set // [php] // // As an object set // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // $o3 = new stdClass; // // $s->attach($o1); // $s->attach($o2); // // var_dump($s->contains($o1)); // var_dump($s->contains($o2)); // var_dump($s->contains($o3)); // // $s->detach($o2); // // var_dump($s->contains($o1)); // var_dump($s->contains($o2)); // var_dump($s->contains($o3)); // [/php] // The above example will output: // [result] // bool(true) // bool(true) // bool(false) // bool(true) // bool(false) // bool(false) // [/result] // [/example] // [example] // Example #2 SplObjectStorage as a map // [php] // // As a map from objects to data // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // $o3 = new stdClass; // // $s[$o1] = "data for object 1"; // $s[$o2] = array(1,2,3); // // if (isset($s[$o2])) { // var_dump($s[$o2]); // } // [/php] // The above example will output: // [result] // array(3) { // [0]=> // int(1) // [1]=> // int(2) // [2]=> // int(3) // } // [/result] // [/example] // [/examples] // // Table of Contents // * SplObjectStorage::addAll - Adds all objects from another storage // * SplObjectStorage::attach - Adds an object in the storage // * SplObjectStorage::contains - Checks if the storage contains a specific object // * SplObjectStorage::count - Returns the number of objects in the storage // * SplObjectStorage::current - Returns the current storage entry // * SplObjectStorage::detach - Removes an object from the storage // * SplObjectStorage::getHash - Calculate a unique identifier for the contained objects // * SplObjectStorage::getInfo - Returns the data associated with the current iterator entry // * SplObjectStorage::key - Returns the index at which the iterator currently is // * SplObjectStorage::next - Move to the next entry // * SplObjectStorage::offsetExists - Checks whether an object exists in the storage // * SplObjectStorage::offsetGet - Returns the data associated with an object // * SplObjectStorage::offsetSet - Associates data to an object in the storage // * SplObjectStorage::offsetUnset - Removes an object from the storage // * SplObjectStorage::removeAll - Removes objects contained in another storage from the current storage // * SplObjectStorage::removeAllExcept - Removes all objects except for those contained in another storage from the current storage // * SplObjectStorage::rewind - Rewind the iterator to the first storage element // * SplObjectStorage::serialize - Serializes the storage // * SplObjectStorage::setInfo - Sets the data associated with the current iterator entry // * SplObjectStorage::unserialize - Unserializes a storage from its string representation // * SplObjectStorage::valid - Returns if the current iterator entry is valid // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splobjectstorage.php // THE_SPLOBJECTSTORAGE_CLASS - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.datastructures.php // DATASTRUCTURES - END // // ITERATORS - BEGIN // Iterators // // THE_APPENDITERATOR_CLASS // THE_ARRAYITERATOR_CLASS // THE_CACHINGITERATOR_CLASS // THE_CALLBACKFILTERITERATOR_CLASS // THE_DIRECTORYITERATOR_CLASS // THE_EMPTYITERATOR_CLASS // THE_FILESYSTEMITERATOR_CLASS // THE_FILTERITERATOR_CLASS // THE_GLOBITERATOR_CLASS // THE_INFINITEITERATOR_CLASS // THE_ITERATORITERATOR_CLASS // THE_LIMITITERATOR_CLASS // THE_MULTIPLEITERATOR_CLASS // THE_NOREWINDITERATOR_CLASS // THE_PARENTITERATOR_CLASS // THE_RECURSIVEARRAYITERATOR_CLASS // THE_RECURSIVECACHINGITERATOR_CLASS // THE_RECURSIVECALLBACKFILTERITERATOR_CLASS // THE_RECURSIVEDIRECTORYITERATOR_CLASS // THE_RECURSIVEFILTERITERATOR_CLASS // THE_RECURSIVEITERATORITERATOR_CLASS // THE_RECURSIVEREGEXITERATOR_CLASS // THE_RECURSIVETREEITERATOR_CLASS // THE_REGEXITERATOR_CLASS // // Table of Contents // * AppendIterator // * ArrayIterator // * CachingIterator // * CallbackFilterIterator // * DirectoryIterator // * EmptyIterator // * FilesystemIterator // * FilterIterator // * GlobIterator // * InfiniteIterator // * IteratorIterator // * LimitIterator // * MultipleIterator // * NoRewindIterator // * ParentIterator // * RecursiveArrayIterator // * RecursiveCachingIterator // * RecursiveCallbackFilterIterator // * RecursiveDirectoryIterator // * RecursiveFilterIterator // * RecursiveIteratorIterator // * RecursiveRegexIterator // * RecursiveTreeIterator // * RegexIterator // SPL provides a set of iterators to traverse over objects. // // SPL Iterators Class Tree // * ArrayIterator // * RecursiveArrayIterator // * EmptyIterator // * IteratorIterator // * AppendIterator // * CachingIterator // * RecursiveCachingIterator // * FilterIterator // * CallbackFilterIterator // * RecursiveCallbackFilterIterator // * RecursiveFilterIterator // * ParentIterator // * RegexIterator // * RecursiveRegexIterator // * InfiniteIterator // * LimitIterator // * NoRewindIterator // * MultipleIterator // * RecursiveIteratorIterator // * RecursiveTreeIterator // * DirectoryIterator (extends SplFileInfo) // * FilesystemIterator // * GlobIterator // * RecursiveDirectoryIterator // // THE_APPENDITERATOR_CLASS - BEGIN // The AppendIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // An Iterator that iterates over several iterators one after the other. // // Class synopsis // [code] // class AppendIterator extends IteratorIterator { // // /* Methods */ // public __construct() // public append(Iterator $iterator): void // public current(): mixed // public getArrayIterator(): ArrayIterator // public getIteratorIndex(): ?int // public key(): scalar // public next(): void // public rewind(): void // public valid(): bool // // /* Inherited methods */ // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * AppendIterator::append - Appends an iterator // * AppendIterator::__construct - Constructs an AppendIterator // * AppendIterator::current - Gets the current value // * AppendIterator::getArrayIterator - Gets the ArrayIterator // * AppendIterator::getIteratorIndex - Gets an index of iterators // * AppendIterator::key - Gets the current key // * AppendIterator::next - Moves to the next element // * AppendIterator::rewind - Rewinds the Iterator // * AppendIterator::valid - Checks validity of the current element // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.appenditerator.php // THE_APPENDITERATOR_CLASS - END // // THE_ARRAYITERATOR_CLASS - BEGIN // The ArrayIterator class // // PHP_5, PHP_7, PHP_8 // // Introduction // Allows the removal of elements, and the modification of keys or values while iterating over Arrays or Objects. // When you want to iterate over the same array multiple times you need to instantiate ArrayObject and let it create ArrayIterator instances that refer to it either by using foreach or by calling its getIterator() method manually. // // Class synopsis // [code] // class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Countable { // // /* Constants */ // public const int STD_PROP_LIST; // public const int ARRAY_AS_PROPS; // // /* Methods */ // public __construct(array|object $array = [], int $flags = 0) // public append(mixed $value): void // public asort(int $flags = SORT_REGULAR): true // public count(): int // public current(): mixed // public getArrayCopy(): array // public getFlags(): int // public key(): string|int|null // public ksort(int $flags = SORT_REGULAR): true // public natcasesort(): true // public natsort(): true // public next(): void // public offsetExists(mixed $key): bool // public offsetGet(mixed $key): mixed // public offsetSet(mixed $key, mixed $value): void // public offsetUnset(mixed $key): void // public rewind(): void // public seek(int $offset): void // public serialize(): string // public setFlags(int $flags): void // public uasort(callable $callback): true // public uksort(callable $callback): true // public unserialize(string $data): void // public valid(): bool // } // [/code] // // Predefined Constants // ArrayIterator Flags // ArrayIterator::STD_PROP_LIST - Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.). // ArrayIterator::ARRAY_AS_PROPS - Entries can be accessed as properties (read and write). // // Table of Contents // * ArrayIterator::append - Append an element // * ArrayIterator::asort - Sort entries by values // * ArrayIterator::__construct - Construct an ArrayIterator // * ArrayIterator::count - Count elements // * ArrayIterator::current - Return current array entry // * ArrayIterator::getArrayCopy - Get array copy // * ArrayIterator::getFlags - Get behavior flags // * ArrayIterator::key - Return current array key // * ArrayIterator::ksort - Sort entries by keys // * ArrayIterator::natcasesort - Sort entries naturally, case insensitive // * ArrayIterator::natsort - Sort entries naturally // * ArrayIterator::next - Move to next entry // * ArrayIterator::offsetExists - Check if offset exists // * ArrayIterator::offsetGet - Get value for an offset // * ArrayIterator::offsetSet - Set value for an offset // * ArrayIterator::offsetUnset - Unset value for an offset // * ArrayIterator::rewind - Rewind array back to the start // * ArrayIterator::seek - Seek to position // * ArrayIterator::serialize - Serialize // * ArrayIterator::setFlags - Set behaviour flags // * ArrayIterator::uasort - Sort with a user-defined comparison function and maintain index association // * ArrayIterator::uksort - Sort by keys using a user-defined comparison function // * ArrayIterator::unserialize - Unserialize // * ArrayIterator::valid - Check whether array contains more entries // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.arrayiterator.php // THE_ARRAYITERATOR_CLASS - END // // THE_CACHINGITERATOR_CLASS - BEGIN // The CachingIterator class // // PHP_5, PHP_7, PHP_8 // // Introduction // This object supports cached iteration over another iterator. // // Class synopsis // [code] // class CachingIterator extends IteratorIterator implements ArrayAccess, Countable, Stringable { // // /* Constants */ // public const int CALL_TOSTRING; // public const int CATCH_GET_CHILD; // public const int TOSTRING_USE_KEY; // public const int TOSTRING_USE_CURRENT; // public const int TOSTRING_USE_INNER; // public const int FULL_CACHE; // // /* Methods */ // public __construct(Iterator $iterator, int $flags = CachingIterator::CALL_TOSTRING) // public count(): int // public current(): mixed // public getCache(): array // public getFlags(): int // public hasNext(): bool // public key(): scalar // public next(): void // public offsetExists(string $key): bool // public offsetGet(string $key): mixed // public offsetSet(string $key, mixed $value): void // public offsetUnset(string $key): void // public rewind(): void // public setFlags(int $flags): void // public __toString(): string // public valid(): bool // // /* Inherited methods */ // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Predefined Constants // CachingIterator::CALL_TOSTRING - Convert every element to string. // CachingIterator::CATCH_GET_CHILD - Don't throw exception in accessing children. // CachingIterator::TOSTRING_USE_KEY - Use key for conversion to string. // CachingIterator::TOSTRING_USE_CURRENT - Use current for conversion to string. // CachingIterator::TOSTRING_USE_INNER - Use inner for conversion to string. // CachingIterator::FULL_CACHE - Cache all read data. // // Changelog // Version - Description // 8.0.0 - CachingIterator implements Stringable now. // // Table of Contents // * CachingIterator::__construct - Construct a new CachingIterator object for the iterator // * CachingIterator::count - The number of elements in the iterator // * CachingIterator::current - Return the current element // * CachingIterator::getCache - Retrieve the contents of the cache // * CachingIterator::getFlags - Get flags used // * CachingIterator::hasNext - Check whether the inner iterator has a valid next element // * CachingIterator::key - Return the key for the current element // * CachingIterator::next - Move the iterator forward // * CachingIterator::offsetExists - The offsetExists purpose // * CachingIterator::offsetGet - The offsetGet purpose // * CachingIterator::offsetSet - The offsetSet purpose // * CachingIterator::offsetUnset - The offsetUnset purpose // * CachingIterator::rewind - Rewind the iterator // * CachingIterator::setFlags - The setFlags purpose // * CachingIterator::__toString - Return the string representation of the current element // * CachingIterator::valid - Check whether the current element is valid // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.cachingiterator.php // THE_CACHINGITERATOR_CLASS - END // // THE_CALLBACKFILTERITERATOR_CLASS - BEGIN // The CallbackFilterIterator class // // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // // Introduction // // Class synopsis // [code] // class CallbackFilterIterator extends FilterIterator { // // /* Methods */ // public __construct(Iterator $iterator, callable $callback) // public accept(): bool // // /* Inherited methods */ // public FilterIterator::accept(): bool // public FilterIterator::current(): mixed // public FilterIterator::key(): mixed // public FilterIterator::next(): void // public FilterIterator::rewind(): void // public FilterIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // [examples] // Examples // [example] // The callback should accept up to three arguments: the current item, the current key and the iterator, respectively. // Example #1 Available callback arguments // [php] // // // // // Callback for CallbackFilterIterator // // // // @param $current Current item's value // // @param $key Current item's key // // @param $iterator Iterator being filtered // // @return boolean TRUE to accept the current item, FALSE otherwise // // // function my_callback($current, $key, $iterator) { // // Your filtering code here // } // // [/php] // Any callable may be used; such as a string containing a function name, an array for a method, or an anonymous function. // [/example] // [example] // Example #2 Callback basic examples // [php] // // $dir = new FilesystemIterator(__DIR__); // // // Filter large files ( > 100MB) // function is_large_file($current) { // return $current->isFile() && $current->getSize() > 104857600; // } // $large_files = new CallbackFilterIterator($dir, 'is_large_file'); // // // Filter directories // $files = new CallbackFilterIterator($dir, function ($current, $key, $iterator) { // return $current->isDir() && ! $iterator->isDot(); // }); // // [/php] // [/example] // [/examples] // // Table of Contents // * CallbackFilterIterator::accept - Calls the callback with the current value, the current key and the inner iterator as arguments // * CallbackFilterIterator::__construct - Create a filtered iterator from another iterator // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.callbackfilteriterator.php // THE_CALLBACKFILTERITERATOR_CLASS - END // // THE_DIRECTORYITERATOR_CLASS - BEGIN // The DirectoryIterator class // // PHP_5, PHP_7, PHP_8 // // Introduction // The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories. // // Class synopsis // [code] // class DirectoryIterator extends SplFileInfo implements SeekableIterator { // // /* Methods */ // public __construct(string $directory) // public current(): mixed // public getBasename(string $suffix = ""): string // public getExtension(): string // public getFilename(): string // public isDot(): bool // public key(): mixed // public next(): void // public rewind(): void // public seek(int $offset): void // public __toString(): string // public valid(): bool // // /* Inherited methods */ // public SplFileInfo::getATime(): int|false // public SplFileInfo::getBasename(string $suffix = ""): string // public SplFileInfo::getCTime(): int|false // public SplFileInfo::getExtension(): string // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // public SplFileInfo::getFilename(): string // public SplFileInfo::getGroup(): int|false // public SplFileInfo::getInode(): int|false // public SplFileInfo::getLinkTarget(): string|false // public SplFileInfo::getMTime(): int|false // public SplFileInfo::getOwner(): int|false // public SplFileInfo::getPath(): string // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // public SplFileInfo::getPathname(): string // public SplFileInfo::getPerms(): int|false // public SplFileInfo::getRealPath(): string|false // public SplFileInfo::getSize(): int|false // public SplFileInfo::getType(): string|false // public SplFileInfo::isDir(): bool // public SplFileInfo::isExecutable(): bool // public SplFileInfo::isFile(): bool // public SplFileInfo::isLink(): bool // public SplFileInfo::isReadable(): bool // public SplFileInfo::isWritable(): bool // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // public SplFileInfo::__toString(): string // } // [/code] // // Table of Contents // * DirectoryIterator::__construct - Constructs a new directory iterator from a path // * DirectoryIterator::current - Return the current DirectoryIterator item // * DirectoryIterator::getBasename - Get base name of current DirectoryIterator item // * DirectoryIterator::getExtension - Gets the file extension // * DirectoryIterator::getFilename - Return file name of current DirectoryIterator item // * DirectoryIterator::isDot - Determine if current DirectoryIterator item is '.' or '..' // * DirectoryIterator::key - Return the key for the current DirectoryIterator item // * DirectoryIterator::next - Move forward to next DirectoryIterator item // * DirectoryIterator::rewind - Rewind the DirectoryIterator back to the start // * DirectoryIterator::seek - Seek to a DirectoryIterator item // * DirectoryIterator::__toString - Get file name as a string // * DirectoryIterator::valid - Check whether current DirectoryIterator position is a valid file // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.directoryiterator.php // THE_DIRECTORYITERATOR_CLASS - END // // THE_EMPTYITERATOR_CLASS - BEGIN // The EmptyIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The EmptyIterator class for an empty iterator. // // Class synopsis // [code] // class EmptyIterator implements Iterator { // // /* Methods */ // public current(): never // public key(): never // public next(): void // public rewind(): void // public valid(): false // } // [/code] // // Table of Contents // * EmptyIterator::current - The current() method // * EmptyIterator::key - The key() method // * EmptyIterator::next - The next() method // * EmptyIterator::rewind - The rewind() method // * EmptyIterator::valid - The valid() method // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.emptyiterator.php // THE_EMPTYITERATOR_CLASS - END // // THE_FILESYSTEMITERATOR_CLASS - BEGIN // The FilesystemIterator class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // The Filesystem iterator // // Class synopsis // [code] // class FilesystemIterator extends DirectoryIterator { // // /* Constants */ // public const int CURRENT_MODE_MASK; // public const int CURRENT_AS_PATHNAME; // public const int CURRENT_AS_FILEINFO; // public const int CURRENT_AS_SELF; // public const int KEY_MODE_MASK; // public const int KEY_AS_PATHNAME; // public const int FOLLOW_SYMLINKS; // public const int KEY_AS_FILENAME; // public const int NEW_CURRENT_AND_KEY; // public const int OTHER_MODE_MASK; // public const int SKIP_DOTS; // public const int UNIX_PATHS; // // /* Methods */ // public __construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS) // public current(): string|SplFileInfo|FilesystemIterator // public getFlags(): int // public key(): string // public next(): void // public rewind(): void // public setFlags(int $flags): void // // /* Inherited methods */ // public DirectoryIterator::current(): mixed // public DirectoryIterator::getBasename(string $suffix = ""): string // public DirectoryIterator::getExtension(): string // public DirectoryIterator::getFilename(): string // public DirectoryIterator::isDot(): bool // public DirectoryIterator::key(): mixed // public DirectoryIterator::next(): void // public DirectoryIterator::rewind(): void // public DirectoryIterator::seek(int $offset): void // public DirectoryIterator::__toString(): string // public DirectoryIterator::valid(): bool // public SplFileInfo::getATime(): int|false // public SplFileInfo::getBasename(string $suffix = ""): string // public SplFileInfo::getCTime(): int|false // public SplFileInfo::getExtension(): string // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // public SplFileInfo::getFilename(): string // public SplFileInfo::getGroup(): int|false // public SplFileInfo::getInode(): int|false // public SplFileInfo::getLinkTarget(): string|false // public SplFileInfo::getMTime(): int|false // public SplFileInfo::getOwner(): int|false // public SplFileInfo::getPath(): string // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // public SplFileInfo::getPathname(): string // public SplFileInfo::getPerms(): int|false // public SplFileInfo::getRealPath(): string|false // public SplFileInfo::getSize(): int|false // public SplFileInfo::getType(): string|false // public SplFileInfo::isDir(): bool // public SplFileInfo::isExecutable(): bool // public SplFileInfo::isFile(): bool // public SplFileInfo::isLink(): bool // public SplFileInfo::isReadable(): bool // public SplFileInfo::isWritable(): bool // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // public SplFileInfo::__toString(): string // } // [/code] // // Predefined Constants // FilesystemIterator::CURRENT_AS_PATHNAME - Makes FilesystemIterator::current() return the pathname. // FilesystemIterator::CURRENT_AS_FILEINFO - Makes FilesystemIterator::current() return an SplFileInfo instance. // FilesystemIterator::CURRENT_AS_SELF - Makes FilesystemIterator::current() return $this (the FilesystemIterator). // FilesystemIterator::CURRENT_MODE_MASK - Masks FilesystemIterator::current() // FilesystemIterator::KEY_AS_PATHNAME - Makes FilesystemIterator::key() return the pathname. // FilesystemIterator::KEY_AS_FILENAME - Makes FilesystemIterator::key() return the filename. // FilesystemIterator::FOLLOW_SYMLINKS - Makes RecursiveDirectoryIterator::hasChildren() follow symlinks. // FilesystemIterator::KEY_MODE_MASK - Masks FilesystemIterator::key() // FilesystemIterator::NEW_CURRENT_AND_KEY - Same as FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::CURRENT_AS_FILEINFO. // FilesystemIterator::OTHER_MODE_MASK - Mask used for FilesystemIterator::getFlags() and FilesystemIterator::setFlags(). // FilesystemIterator::SKIP_DOTS - Skips dot files (. and ..). // FilesystemIterator::UNIX_PATHS - Makes paths use Unix-style forward slash irrespective of system default. Note that the path that is passed to the constructor is not modified. // // Table of Contents // * FilesystemIterator::__construct - Constructs a new filesystem iterator // * FilesystemIterator::current - The current file // * FilesystemIterator::getFlags - Get the handling flags // * FilesystemIterator::key - Retrieve the key for the current file // * FilesystemIterator::next - Move to the next file // * FilesystemIterator::rewind - Rewinds back to the beginning // * FilesystemIterator::setFlags - Sets handling flags // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.filesystemiterator.php // THE_FILESYSTEMITERATOR_CLASS - END // // THE_FILTERITERATOR_CLASS - BEGIN // The FilterIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // This abstract iterator filters out unwanted values. This class should be extended to implement custom iterator filters. The FilterIterator::accept() must be implemented in the subclass. // // Class synopsis // [code] // abstract class FilterIterator extends IteratorIterator { // // /* Methods */ // public __construct(Iterator $iterator) // public accept(): bool // public current(): mixed // public key(): mixed // public next(): void // public rewind(): void // public valid(): bool // // /* Inherited methods */ // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * FilterIterator::accept - Check whether the current element of the iterator is acceptable // * FilterIterator::__construct - Construct a filterIterator // * FilterIterator::current - Get the current element value // * FilterIterator::key - Get the current key // * FilterIterator::next - Move the iterator forward // * FilterIterator::rewind - Rewind the iterator // * FilterIterator::valid - Check whether the current element is valid // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.filteriterator.php // THE_FILTERITERATOR_CLASS - END // // THE_GLOBITERATOR_CLASS - BEGIN // The GlobIterator class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // Iterates through a file system in a similar fashion to glob(). // // Class synopsis // [code] // class GlobIterator extends FilesystemIterator implements Countable { // // /* Inherited constants */ // public const int FilesystemIterator::CURRENT_MODE_MASK; // public const int FilesystemIterator::CURRENT_AS_PATHNAME; // public const int FilesystemIterator::CURRENT_AS_FILEINFO; // public const int FilesystemIterator::CURRENT_AS_SELF; // public const int FilesystemIterator::KEY_MODE_MASK; // public const int FilesystemIterator::KEY_AS_PATHNAME; // public const int FilesystemIterator::FOLLOW_SYMLINKS; // public const int FilesystemIterator::KEY_AS_FILENAME; // public const int FilesystemIterator::NEW_CURRENT_AND_KEY; // public const int FilesystemIterator::OTHER_MODE_MASK; // public const int FilesystemIterator::SKIP_DOTS; // public const int FilesystemIterator::UNIX_PATHS; // // /* Methods */ // public __construct(string $pattern, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO) // public count(): int // // /* Inherited methods */ // public FilesystemIterator::current(): string|SplFileInfo|FilesystemIterator // public FilesystemIterator::getFlags(): int // public FilesystemIterator::key(): string // public FilesystemIterator::next(): void // public FilesystemIterator::rewind(): void // public FilesystemIterator::setFlags(int $flags): void // public DirectoryIterator::current(): mixed // public DirectoryIterator::getBasename(string $suffix = ""): string // public DirectoryIterator::getExtension(): string // public DirectoryIterator::getFilename(): string // public DirectoryIterator::isDot(): bool // public DirectoryIterator::key(): mixed // public DirectoryIterator::next(): void // public DirectoryIterator::rewind(): void // public DirectoryIterator::seek(int $offset): void // public DirectoryIterator::__toString(): string // public DirectoryIterator::valid(): bool // public SplFileInfo::getATime(): int|false // public SplFileInfo::getBasename(string $suffix = ""): string // public SplFileInfo::getCTime(): int|false // public SplFileInfo::getExtension(): string // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // public SplFileInfo::getFilename(): string // public SplFileInfo::getGroup(): int|false // public SplFileInfo::getInode(): int|false // public SplFileInfo::getLinkTarget(): string|false // public SplFileInfo::getMTime(): int|false // public SplFileInfo::getOwner(): int|false // public SplFileInfo::getPath(): string // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // public SplFileInfo::getPathname(): string // public SplFileInfo::getPerms(): int|false // public SplFileInfo::getRealPath(): string|false // public SplFileInfo::getSize(): int|false // public SplFileInfo::getType(): string|false // public SplFileInfo::isDir(): bool // public SplFileInfo::isExecutable(): bool // public SplFileInfo::isFile(): bool // public SplFileInfo::isLink(): bool // public SplFileInfo::isReadable(): bool // public SplFileInfo::isWritable(): bool // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // public SplFileInfo::__toString(): string // } // [/code] // // Table of Contents // * GlobIterator::__construct - Construct a directory using glob // * GlobIterator::count - Get the number of directories and files // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.globiterator.php // THE_GLOBITERATOR_CLASS - END // // THE_INFINITEITERATOR_CLASS - BEGIN // The InfiniteIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The InfiniteIterator allows one to infinitely iterate over an iterator without having to manually rewind the iterator upon reaching its end. // // Class synopsis // [code] // class InfiniteIterator extends IteratorIterator { // // /* Methods */ // public __construct(Iterator $iterator) // public next(): void // // /* Inherited methods */ // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * InfiniteIterator::__construct - Constructs an InfiniteIterator // * InfiniteIterator::next - Moves the inner Iterator forward or rewinds it // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.infiniteiterator.php // THE_INFINITEITERATOR_CLASS - END // // THE_ITERATORITERATOR_CLASS - BEGIN // The IteratorIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // This iterator wrapper allows the conversion of anything that is Traversable into an Iterator. It is important to understand that most classes that do not implement Iterators have reasons as most likely they do not allow the full Iterator feature set. If so, techniques should be provided to prevent misuse, otherwise expect exceptions or fatal errors. // // Class synopsis // [code] // class IteratorIterator implements OuterIterator { // // /* Methods */ // public __construct(Traversable $iterator, ?string $class = null) // public current(): mixed // public getInnerIterator(): ?Iterator // public key(): mixed // public next(): void // public rewind(): void // public valid(): bool // } // [/code] // // Notes // Note: This class permits access to methods of the inner iterator via the __call magic method. // // Table of Contents // * IteratorIterator::__construct - Create an iterator from anything that is traversable // * IteratorIterator::current - Get the current value // * IteratorIterator::getInnerIterator - Get the inner iterator // * IteratorIterator::key - Get the key of the current element // * IteratorIterator::next - Forward to the next element // * IteratorIterator::rewind - Rewind to the first element // * IteratorIterator::valid - Checks if the iterator is valid // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.iteratoriterator.php // THE_ITERATORITERATOR_CLASS - END // // THE_LIMITITERATOR_CLASS - BEGIN // The LimitIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The LimitIterator class allows iteration over a limited subset of items in an Iterator. // // Class synopsis // [code] // class LimitIterator extends IteratorIterator { // // /* Methods */ // public __construct(Iterator $iterator, int $offset = 0, int $limit = -1) // public current(): mixed // public getPosition(): int // public key(): mixed // public next(): void // public rewind(): void // public seek(int $offset): int // public valid(): bool // // /* Inherited methods */ // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // [examples] // Examples // [example] // Example #1 LimitIterator usage example // [php] // // // Create an iterator to be limited // $fruits = new ArrayIterator(array( // 'apple', // 'banana', // 'cherry', // 'damson', // 'elderberry' // )); // // // Loop over first three fruits only // foreach (new LimitIterator($fruits, 0, 3) as $fruit) { // var_dump($fruit); // } // // echo "\n"; // // // Loop from third fruit until the end // // Note: offset starts from zero for apple // foreach (new LimitIterator($fruits, 2) as $fruit) { // var_dump($fruit); // } // // [/php] // The above example will output: // [result] // string(5) "apple" // string(6) "banana" // string(6) "cherry" // string(6) "cherry" // string(6) "damson" // string(10) "elderberry" // [/result] // [/example] // [/examples] // // Table of Contents // * LimitIterator::__construct - Construct a LimitIterator // * LimitIterator::current - Get current element // * LimitIterator::getPosition - Return the current position // * LimitIterator::key - Get current key // * LimitIterator::next - Move the iterator forward // * LimitIterator::rewind - Rewind the iterator to the specified starting offset // * LimitIterator::seek - Seek to the given position // * LimitIterator::valid - Check whether the current element is valid // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.limititerator.php // THE_LIMITITERATOR_CLASS - END // // THE_MULTIPLEITERATOR_CLASS - BEGIN // The MultipleIterator class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // An Iterator that sequentially iterates over all attached iterators // // Class synopsis // [code] // class MultipleIterator implements Iterator { // // /* Constants */ // public const int MIT_NEED_ANY; // public const int MIT_NEED_ALL; // public const int MIT_KEYS_NUMERIC; // public const int MIT_KEYS_ASSOC; // // /* Methods */ // public __construct(int $flags = MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC) // public attachIterator(Iterator $iterator, string|int|null $info = null): void // public containsIterator(Iterator $iterator): bool // public countIterators(): int // public current(): array // public detachIterator(Iterator $iterator): void // public getFlags(): int // public key(): array // public next(): void // public rewind(): void // public setFlags(int $flags): void // public valid(): bool // } // [/code] // // Predefined Constants // MultipleIterator::MIT_NEED_ANY - Do not require all sub iterators to be valid in iteration. // MultipleIterator::MIT_NEED_ALL - Require all sub iterators to be valid in iteration. // MultipleIterator::MIT_KEYS_NUMERIC - Keys are created from the sub iterators position. // MultipleIterator::MIT_KEYS_ASSOC - Keys are created from sub iterators associated information. // // Table of Contents // * MultipleIterator::attachIterator - Attaches iterator information // * MultipleIterator::__construct - Constructs a new MultipleIterator // * MultipleIterator::containsIterator - Checks if an iterator is attached // * MultipleIterator::countIterators - Gets the number of attached iterator instances // * MultipleIterator::current - Gets the registered iterator instances // * MultipleIterator::detachIterator - Detaches an iterator // * MultipleIterator::getFlags - Gets the flag information // * MultipleIterator::key - Gets the registered iterator instances // * MultipleIterator::next - Moves all attached iterator instances forward // * MultipleIterator::rewind - Rewinds all attached iterator instances // * MultipleIterator::setFlags - Sets flags // * MultipleIterator::valid - Checks the validity of sub iterators // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.multipleiterator.php // THE_MULTIPLEITERATOR_CLASS - END // // THE_NOREWINDITERATOR_CLASS - BEGIN // The NoRewindIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // This iterator ignores rewind operations. This allows processing an iterator in multiple partial foreach loops. // // Class synopsis // [code] // class NoRewindIterator extends IteratorIterator { // // /* Methods */ // public __construct(Iterator $iterator) // public current(): mixed // public key(): mixed // public next(): void // public rewind(): void // public valid(): bool // // /* Inherited methods */ // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * NoRewindIterator::__construct - Construct a NoRewindIterator // * NoRewindIterator::current - Get the current value // * NoRewindIterator::key - Get the current key // * NoRewindIterator::next - Forward to the next element // * NoRewindIterator::rewind - Prevents the rewind operation on the inner iterator // * NoRewindIterator::valid - Validates the iterator // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.norewinditerator.php // THE_NOREWINDITERATOR_CLASS - END // // THE_PARENTITERATOR_CLASS - BEGIN // The ParentIterator class // // PHP_5 >= PHP_5_1_0, PHP 7, PHP 8 // // Introduction // This extended FilterIterator allows a recursive iteration using RecursiveIteratorIterator that only shows those elements which have children. // // Class synopsis // [code] // class ParentIterator extends RecursiveFilterIterator { // // /* Methods */ // public __construct(RecursiveIterator $iterator) // public accept(): bool // public getChildren(): ParentIterator // public hasChildren(): bool // public next(): void // public rewind(): void // // /* Inherited methods */ // public RecursiveFilterIterator::getChildren(): ?RecursiveFilterIterator // public RecursiveFilterIterator::hasChildren(): bool // public FilterIterator::accept(): bool // public FilterIterator::current(): mixed // public FilterIterator::key(): mixed // public FilterIterator::next(): void // public FilterIterator::rewind(): void // public FilterIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * ParentIterator::accept - Determines acceptability // * ParentIterator::__construct - Constructs a ParentIterator // * ParentIterator::getChildren - Return the inner iterator's children contained in a ParentIterator // * ParentIterator::hasChildren - Check whether the inner iterator's current element has children // * ParentIterator::next - Move the iterator forward // * ParentIterator::rewind - Rewind the iterator // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.parentiterator.php // THE_PARENTITERATOR_CLASS - END // // THE_RECURSIVEARRAYITERATOR_CLASS - BEGIN // The RecursiveArrayIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // This iterator allows to unset and modify values and keys while iterating over Arrays and Objects in the same way as the ArrayIterator. Additionally it is possible to iterate over the current iterator entry. // // Class synopsis // [code] // class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator { // // /* Inherited constants */ // public const int ArrayIterator::STD_PROP_LIST; // public const int ArrayIterator::ARRAY_AS_PROPS; // // /* Constants */ // public const int CHILD_ARRAYS_ONLY; // // /* Methods */ // public getChildren(): ?RecursiveArrayIterator // public hasChildren(): bool // // /* Inherited methods */ // public ArrayIterator::__construct(array|object $array = [], int $flags = 0) // public ArrayIterator::append(mixed $value): void // public ArrayIterator::asort(int $flags = SORT_REGULAR): true // public ArrayIterator::count(): int // public ArrayIterator::current(): mixed // public ArrayIterator::getArrayCopy(): array // public ArrayIterator::getFlags(): int // public ArrayIterator::key(): string|int|null // public ArrayIterator::ksort(int $flags = SORT_REGULAR): true // public ArrayIterator::natcasesort(): true // public ArrayIterator::natsort(): true // public ArrayIterator::next(): void // public ArrayIterator::offsetExists(mixed $key): bool // public ArrayIterator::offsetGet(mixed $key): mixed // public ArrayIterator::offsetSet(mixed $key, mixed $value): void // public ArrayIterator::offsetUnset(mixed $key): void // public ArrayIterator::rewind(): void // public ArrayIterator::seek(int $offset): void // public ArrayIterator::serialize(): string // public ArrayIterator::setFlags(int $flags): void // public ArrayIterator::uasort(callable $callback): true // public ArrayIterator::uksort(callable $callback): true // public ArrayIterator::unserialize(string $data): void // public ArrayIterator::valid(): bool // } // [/code] // // Predefined Constants // RecursiveArrayIterator Flags // RecursiveArrayIterator::CHILD_ARRAYS_ONLY - Treat only arrays (not objects) as having children for recursive iteration. // // Table of Contents // * RecursiveArrayIterator::getChildren - Returns an iterator for the current entry if it is an array or an object // * RecursiveArrayIterator::hasChildren - Returns whether current entry is an array or an object // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursivearrayiterator.php // THE_RECURSIVEARRAYITERATOR_CLASS - END // // THE_RECURSIVECACHINGITERATOR_CLASS - BEGIN // The RecursiveCachingIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // ... // // Class synopsis // [code] // class RecursiveCachingIterator extends CachingIterator implements RecursiveIterator { // // /* Inherited constants */ // public const int CachingIterator::CALL_TOSTRING; // public const int CachingIterator::CATCH_GET_CHILD; // public const int CachingIterator::TOSTRING_USE_KEY; // public const int CachingIterator::TOSTRING_USE_CURRENT; // public const int CachingIterator::TOSTRING_USE_INNER; // public const int CachingIterator::FULL_CACHE; // // /* Methods */ // public __construct(Iterator $iterator, int $flags = RecursiveCachingIterator::CALL_TOSTRING) // public getChildren(): ?RecursiveCachingIterator // public hasChildren(): bool // // /* Inherited methods */ // public CachingIterator::count(): int // public CachingIterator::current(): mixed // public CachingIterator::getCache(): array // public CachingIterator::getFlags(): int // public CachingIterator::hasNext(): bool // public CachingIterator::key(): scalar // public CachingIterator::next(): void // public CachingIterator::offsetExists(string $key): bool // public CachingIterator::offsetGet(string $key): mixed // public CachingIterator::offsetSet(string $key, mixed $value): void // public CachingIterator::offsetUnset(string $key): void // public CachingIterator::rewind(): void // public CachingIterator::setFlags(int $flags): void // public CachingIterator::__toString(): string // public CachingIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * RecursiveCachingIterator::__construct - Construct // * RecursiveCachingIterator::getChildren - Return the inner iterator's children as a RecursiveCachingIterator // * RecursiveCachingIterator::hasChildren - Check whether the current element of the inner iterator has children // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursivecachingiterator.php // THE_RECURSIVECACHINGITERATOR_CLASS - END // // THE_RECURSIVECALLBACKFILTERITERATOR_CLASS - BEGIN // The RecursiveCallbackFilterIterator class // // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // // Introduction // // Class synopsis // [code] // class RecursiveCallbackFilterIterator extends CallbackFilterIterator implements RecursiveIterator { // // /* Methods */ // public __construct(RecursiveIterator $iterator, callable $callback) // public getChildren(): RecursiveCallbackFilterIterator // public hasChildren(): bool // // /* Inherited methods */ // public CallbackFilterIterator::accept(): bool // public FilterIterator::accept(): bool // public FilterIterator::current(): mixed // public FilterIterator::key(): mixed // public FilterIterator::next(): void // public FilterIterator::rewind(): void // public FilterIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // [examples] // Examples // [example] // The callback should accept up to three arguments: the current item, the current key and the iterator, respectively. // Example #1 Available callback arguments // [php] // // // // // Callback for RecursiveCallbackFilterIterator // // // // @param $current Current item's value // // @param $key Current item's key // // @param $iterator Iterator being filtered // // @return boolean TRUE to accept the current item, FALSE otherwise // /// // function my_callback($current, $key, $iterator) { // // Your filtering code here // } // // [/php] // [/example] // [example] // Filtering a recursive iterator generally involves two conditions. The first is that, to allow recursion, the callback function should return true if the current iterator item has children. The second is the normal filter condition, such as a file size or extension check as in the example below. // Example #2 Recursive callback basic example // [php] // // $dir = new RecursiveDirectoryIterator(__DIR__); // // // Filter large files ( > 100MB) // $files = new RecursiveCallbackFilterIterator($dir, function ($current, $key, $iterator) { // // Allow recursion // if ($iterator->hasChildren()) { // return TRUE; // } // // Check for large file // if ($current->isFile() && $current->getSize() > 104857600) { // return TRUE; // } // return FALSE; // }); // // foreach (new RecursiveIteratorIterator($files) as $file) { // echo $file->getPathname() . PHP_EOL; // } // // [/php] // [/example] // [/examples] // // Table of Contents // * RecursiveCallbackFilterIterator::__construct - Create a RecursiveCallbackFilterIterator from a RecursiveIterator // * RecursiveCallbackFilterIterator::getChildren - Return the inner iterator's children contained in a RecursiveCallbackFilterIterator // * RecursiveCallbackFilterIterator::hasChildren - Check whether the inner iterator's current element has children // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursivecallbackfilteriterator.php // THE_RECURSIVECALLBACKFILTERITERATOR_CLASS - END // // THE_RECURSIVEDIRECTORYITERATOR_CLASS - BEGIN // The RecursiveDirectoryIterator class // // PHP_5, PHP_7, PHP_8 // // Introduction // The RecursiveDirectoryIterator provides an interface for iterating recursively over filesystem directories. // // Class synopsis // [code] // class RecursiveDirectoryIterator extends FilesystemIterator implements RecursiveIterator { // // /* Inherited constants */ // public const int FilesystemIterator::CURRENT_MODE_MASK; // public const int FilesystemIterator::CURRENT_AS_PATHNAME; // public const int FilesystemIterator::CURRENT_AS_FILEINFO; // public const int FilesystemIterator::CURRENT_AS_SELF; // public const int FilesystemIterator::KEY_MODE_MASK; // public const int FilesystemIterator::KEY_AS_PATHNAME; // public const int FilesystemIterator::FOLLOW_SYMLINKS; // public const int FilesystemIterator::KEY_AS_FILENAME; // public const int FilesystemIterator::NEW_CURRENT_AND_KEY; // public const int FilesystemIterator::OTHER_MODE_MASK; // public const int FilesystemIterator::SKIP_DOTS; // public const int FilesystemIterator::UNIX_PATHS; // // /* Methods */ // public __construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO) // public getChildren(): RecursiveDirectoryIterator // public getSubPath(): string // public getSubPathname(): string // public hasChildren(bool $allowLinks = false): bool // public key(): string // public next(): void // public rewind(): void // // /* Inherited methods */ // public FilesystemIterator::current(): string|SplFileInfo|FilesystemIterator // public FilesystemIterator::getFlags(): int // public FilesystemIterator::key(): string // public FilesystemIterator::next(): void // public FilesystemIterator::rewind(): void // public FilesystemIterator::setFlags(int $flags): void // public DirectoryIterator::current(): mixed // public DirectoryIterator::getBasename(string $suffix = ""): string // public DirectoryIterator::getExtension(): string // public DirectoryIterator::getFilename(): string // public DirectoryIterator::isDot(): bool // public DirectoryIterator::key(): mixed // public DirectoryIterator::next(): void // public DirectoryIterator::rewind(): void // public DirectoryIterator::seek(int $offset): void // public DirectoryIterator::__toString(): string // public DirectoryIterator::valid(): bool // public SplFileInfo::getATime(): int|false // public SplFileInfo::getBasename(string $suffix = ""): string // public SplFileInfo::getCTime(): int|false // public SplFileInfo::getExtension(): string // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // public SplFileInfo::getFilename(): string // public SplFileInfo::getGroup(): int|false // public SplFileInfo::getInode(): int|false // public SplFileInfo::getLinkTarget(): string|false // public SplFileInfo::getMTime(): int|false // public SplFileInfo::getOwner(): int|false // public SplFileInfo::getPath(): string // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // public SplFileInfo::getPathname(): string // public SplFileInfo::getPerms(): int|false // public SplFileInfo::getRealPath(): string|false // public SplFileInfo::getSize(): int|false // public SplFileInfo::getType(): string|false // public SplFileInfo::isDir(): bool // public SplFileInfo::isExecutable(): bool // public SplFileInfo::isFile(): bool // public SplFileInfo::isLink(): bool // public SplFileInfo::isReadable(): bool // public SplFileInfo::isWritable(): bool // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // public SplFileInfo::__toString(): string // } // [/code] // // Table of Contents // * RecursiveDirectoryIterator::__construct - Constructs a RecursiveDirectoryIterator // * RecursiveDirectoryIterator::getChildren - Returns an iterator for the current entry if it is a directory // * RecursiveDirectoryIterator::getSubPath - Get sub path // * RecursiveDirectoryIterator::getSubPathname - Get sub path and name // * RecursiveDirectoryIterator::hasChildren - Returns whether current entry is a directory and not '.' or '..' // * RecursiveDirectoryIterator::key - Return path and filename of current dir entry // * RecursiveDirectoryIterator::next - Move to next entry // * RecursiveDirectoryIterator::rewind - Rewind dir back to the start // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursivedirectoryiterator.php // THE_RECURSIVEDIRECTORYITERATOR_CLASS - END // // THE_RECURSIVEFILTERITERATOR_CLASS - BEGIN // The RecursiveFilterIterator class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // This abstract iterator filters out unwanted values for a RecursiveIterator. This class should be extended to implement custom filters. The RecursiveFilterIterator::accept() must be implemented in the subclass. // // Class synopsis // [code] // abstract class RecursiveFilterIterator extends FilterIterator implements RecursiveIterator { // // /* Methods */ // public __construct(RecursiveIterator $iterator) // public getChildren(): ?RecursiveFilterIterator // public hasChildren(): bool // // /* Inherited methods */ // public FilterIterator::accept(): bool // public FilterIterator::current(): mixed // public FilterIterator::key(): mixed // public FilterIterator::next(): void // public FilterIterator::rewind(): void // public FilterIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * RecursiveFilterIterator::__construct - Create a RecursiveFilterIterator from a RecursiveIterator // * RecursiveFilterIterator::getChildren - Return the inner iterator's children contained in a RecursiveFilterIterator // * RecursiveFilterIterator::hasChildren - Check whether the inner iterator's current element has children // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursivefilteriterator.php // THE_RECURSIVEFILTERITERATOR_CLASS - END // // THE_RECURSIVEITERATORITERATOR_CLASS - BEGIN // The RecursiveIteratorIterator class // // PHP_5, PHP_7, PHP_8 // // Introduction // Can be used to iterate through recursive iterators. // // Class synopsis // [code] // class RecursiveIteratorIterator implements OuterIterator { // // /* Constants */ // public const int LEAVES_ONLY; // public const int SELF_FIRST; // public const int CHILD_FIRST; // public const int CATCH_GET_CHILD; // // /* Methods */ // public __construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0) // public beginChildren(): void // public beginIteration(): void // public callGetChildren(): ?RecursiveIterator // public callHasChildren(): bool // public current(): mixed // public endChildren(): void // public endIteration(): void // public getDepth(): int // public getInnerIterator(): RecursiveIterator // public getMaxDepth(): int|false // public getSubIterator(?int $level = null): ?RecursiveIterator // public key(): mixed // public next(): void // public nextElement(): void // public rewind(): void // public setMaxDepth(int $maxDepth = -1): void // public valid(): bool // } // [/code] // // Predefined Constants // RecursiveIteratorIterator::LEAVES_ONLY // RecursiveIteratorIterator::SELF_FIRST // RecursiveIteratorIterator::CHILD_FIRST // RecursiveIteratorIterator::CATCH_GET_CHILD // // Table of Contents // * RecursiveIteratorIterator::beginChildren - Begin children // * RecursiveIteratorIterator::beginIteration - Begin Iteration // * RecursiveIteratorIterator::callGetChildren - Get children // * RecursiveIteratorIterator::callHasChildren - Has children // * RecursiveIteratorIterator::__construct - Construct a RecursiveIteratorIterator // * RecursiveIteratorIterator::current - Access the current element value // * RecursiveIteratorIterator::endChildren - End children // * RecursiveIteratorIterator::endIteration - End Iteration // * RecursiveIteratorIterator::getDepth - Get the current depth of the recursive iteration // * RecursiveIteratorIterator::getInnerIterator - Get inner iterator // * RecursiveIteratorIterator::getMaxDepth - Get max depth // * RecursiveIteratorIterator::getSubIterator - The current active sub iterator // * RecursiveIteratorIterator::key - Access the current key // * RecursiveIteratorIterator::next - Move forward to the next element // * RecursiveIteratorIterator::nextElement - Next element // * RecursiveIteratorIterator::rewind - Rewind the iterator to the first element of the top level inner iterator // * RecursiveIteratorIterator::setMaxDepth - Set max depth // * RecursiveIteratorIterator::valid - Check whether the current position is valid // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursiveiteratoriterator.php // THE_RECURSIVEITERATORITERATOR_CLASS - END // // THE_RECURSIVEREGEXITERATOR_CLASS - BEGIN // The RecursiveRegexIterator class // // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // // Introduction // This recursive iterator can filter another recursive iterator via a regular expression. // // Class synopsis // [code] // class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator { // // /* Inherited constants */ // public const int RegexIterator::USE_KEY; // public const int RegexIterator::INVERT_MATCH; // public const int RegexIterator::MATCH; // public const int RegexIterator::GET_MATCH; // public const int RegexIterator::ALL_MATCHES; // public const int RegexIterator::SPLIT; // public const int RegexIterator::REPLACE; // // /* Inherited properties */ // public ?string $replacement = null; // // /* Methods */ // public __construct( // RecursiveIterator $iterator, // string $pattern, // int $mode = RecursiveRegexIterator::MATCH, // int $flags = 0, // int $pregFlags = 0 // ) // public getChildren(): RecursiveRegexIterator // public hasChildren(): bool // // /* Inherited methods */ // public RegexIterator::accept(): bool // public RegexIterator::getFlags(): int // public RegexIterator::getMode(): int // public RegexIterator::getPregFlags(): int // public RegexIterator::getRegex(): string // public RegexIterator::setFlags(int $flags): void // public RegexIterator::setMode(int $mode): void // public RegexIterator::setPregFlags(int $pregFlags): void // public FilterIterator::accept(): bool // public FilterIterator::current(): mixed // public FilterIterator::key(): mixed // public FilterIterator::next(): void // public FilterIterator::rewind(): void // public FilterIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Table of Contents // * RecursiveRegexIterator::__construct - Creates a new RecursiveRegexIterator // * RecursiveRegexIterator::getChildren - Returns an iterator for the current entry // * RecursiveRegexIterator::hasChildren - Returns whether an iterator can be obtained for the current entry // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursiveregexiterator.php // THE_RECURSIVEREGEXITERATOR_CLASS - END // // THE_RECURSIVETREEITERATOR_CLASS - BEGIN // The RecursiveTreeIterator class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // Allows iterating over a RecursiveIterator to generate an ASCII graphic tree. // // Class synopsis // [code] // class RecursiveTreeIterator extends RecursiveIteratorIterator { // // /* Inherited constants */ // public const int RecursiveIteratorIterator::LEAVES_ONLY; // public const int RecursiveIteratorIterator::SELF_FIRST; // public const int RecursiveIteratorIterator::CHILD_FIRST; // public const int RecursiveIteratorIterator::CATCH_GET_CHILD; // // /* Constants */ // public const int BYPASS_CURRENT; // public const int BYPASS_KEY; // public const int PREFIX_LEFT; // public const int PREFIX_MID_HAS_NEXT = 1; // public const int PREFIX_MID_LAST = 2; // public const int PREFIX_END_HAS_NEXT = 3; // public const int PREFIX_END_LAST = 4; // public const int PREFIX_RIGHT = 5; // // /* Methods */ // public __construct( // RecursiveIterator|IteratorAggregate $iterator, // int $flags = RecursiveTreeIterator::BYPASS_KEY, // int $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD, // int $mode = RecursiveTreeIterator::SELF_FIRST // ) // public beginChildren(): void // public beginIteration(): RecursiveIterator // public callGetChildren(): RecursiveIterator // public callHasChildren(): bool // public current(): mixed // public endChildren(): void // public endIteration(): void // public getEntry(): string // public getPostfix(): string // public getPrefix(): string // public key(): mixed // public next(): void // public nextElement(): void // public rewind(): void // public setPostfix(string $postfix): void // public setPrefixPart(int $part, string $value): void // public valid(): bool // // /* Inherited methods */ // public RecursiveIteratorIterator::beginChildren(): void // public RecursiveIteratorIterator::beginIteration(): void // public RecursiveIteratorIterator::callGetChildren(): ?RecursiveIterator // public RecursiveIteratorIterator::callHasChildren(): bool // public RecursiveIteratorIterator::current(): mixed // public RecursiveIteratorIterator::endChildren(): void // public RecursiveIteratorIterator::endIteration(): void // public RecursiveIteratorIterator::getDepth(): int // public RecursiveIteratorIterator::getInnerIterator(): RecursiveIterator // public RecursiveIteratorIterator::getMaxDepth(): int|false // public RecursiveIteratorIterator::getSubIterator(?int $level = null): ?RecursiveIterator // public RecursiveIteratorIterator::key(): mixed // public RecursiveIteratorIterator::next(): void // public RecursiveIteratorIterator::nextElement(): void // public RecursiveIteratorIterator::rewind(): void // public RecursiveIteratorIterator::setMaxDepth(int $maxDepth = -1): void // public RecursiveIteratorIterator::valid(): bool // } // [/code] // // Predefined Constants // RecursiveTreeIterator::BYPASS_CURRENT // RecursiveTreeIterator::BYPASS_KEY // RecursiveTreeIterator::PREFIX_LEFT // RecursiveTreeIterator::PREFIX_MID_HAS_NEXT // RecursiveTreeIterator::PREFIX_MID_LAST // RecursiveTreeIterator::PREFIX_END_HAS_NEXT // RecursiveTreeIterator::PREFIX_END_LAST // RecursiveTreeIterator::PREFIX_RIGHT // // Table of Contents // * RecursiveTreeIterator::beginChildren - Begin children // * RecursiveTreeIterator::beginIteration - Begin iteration // * RecursiveTreeIterator::callGetChildren - Get children // * RecursiveTreeIterator::callHasChildren - Has children // * RecursiveTreeIterator::__construct - Construct a RecursiveTreeIterator // * RecursiveTreeIterator::current - Get current element // * RecursiveTreeIterator::endChildren - End children // * RecursiveTreeIterator::endIteration - End iteration // * RecursiveTreeIterator::getEntry - Get current entry // * RecursiveTreeIterator::getPostfix - Get the postfix // * RecursiveTreeIterator::getPrefix - Get the prefix // * RecursiveTreeIterator::key - Get the key of the current element // * RecursiveTreeIterator::next - Move to next element // * RecursiveTreeIterator::nextElement - Next element // * RecursiveTreeIterator::rewind - Rewind iterator // * RecursiveTreeIterator::setPostfix - Set postfix // * RecursiveTreeIterator::setPrefixPart - Set a part of the prefix // * RecursiveTreeIterator::valid - Check validity // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursivetreeiterator.php // THE_RECURSIVETREEITERATOR_CLASS - END // // THE_REGEXITERATOR_CLASS - BEGIN // The RegexIterator class // // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // // Introduction // This iterator can be used to filter another iterator based on a regular expression. // // Class synopsis // [code] // class RegexIterator extends FilterIterator { // // /* Constants */ // public const int USE_KEY; // public const int INVERT_MATCH; // public const int MATCH; // public const int GET_MATCH; // public const int ALL_MATCHES; // public const int SPLIT; // public const int REPLACE; // // /* Properties */ // public ?string $replacement = null; // // /* Methods */ // public __construct( // Iterator $iterator, // string $pattern, // int $mode = RegexIterator::MATCH, // int $flags = 0, // int $pregFlags = 0 // ) // public accept(): bool // public getFlags(): int // public getMode(): int // public getPregFlags(): int // public getRegex(): string // public setFlags(int $flags): void // public setMode(int $mode): void // public setPregFlags(int $pregFlags): void // // /* Inherited methods */ // public FilterIterator::accept(): bool // public FilterIterator::current(): mixed // public FilterIterator::key(): mixed // public FilterIterator::next(): void // public FilterIterator::rewind(): void // public FilterIterator::valid(): bool // public IteratorIterator::current(): mixed // public IteratorIterator::getInnerIterator(): ?Iterator // public IteratorIterator::key(): mixed // public IteratorIterator::next(): void // public IteratorIterator::rewind(): void // public IteratorIterator::valid(): bool // } // [/code] // // Predefined Constants // RegexIterator operation modes // RegexIterator::ALL_MATCHES - Return all matches for the current entry (see preg_match_all()). // RegexIterator::GET_MATCH - Return the first match for the current entry (see preg_match()). // RegexIterator::MATCH - Only execute match (filter) for the current entry (see preg_match()). // RegexIterator::REPLACE - Replace the current entry (see preg_replace(); Not fully implemented yet) // RegexIterator::SPLIT - Returns the split values for the current entry (see preg_split()). // RegexIterator Flags // RegexIterator::USE_KEY - Special flag: Match the entry key instead of the entry value. // RegexIterator::INVERT_MATCH - Inverts the return value of RegexIterator::accept(). // // Properties // replacement // // Table of Contents // * RegexIterator::accept - Get accept status // * RegexIterator::__construct - Create a new RegexIterator // * RegexIterator::getFlags - Get flags // * RegexIterator::getMode - Returns operation mode // * RegexIterator::getPregFlags - Returns the regular expression flags // * RegexIterator::getRegex - Returns current regular expression // * RegexIterator::setFlags - Sets the flags // * RegexIterator::setMode - Sets the operation mode // * RegexIterator::setPregFlags - Sets the regular expression flags // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.regexiterator.php // THE_REGEXITERATOR_CLASS - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.iterators.php // ITERATORS - END // // INTERFACES - BEGIN // Interfaces // // THE_COUNTABLE_INTERFACE // THE_OUTERITERATOR_INTERFACE // THE_RECURSIVEITERATOR_INTERFACE // THE_SEEKABLEITERATOR_INTERFACE // THE_SPLOBSERVER_INTERFACE // THE_SPLSUBJECT_INTERFACE // // Table of Contents // * Countable // * OuterIterator // * RecursiveIterator // * SeekableIterator // // SPL provides a set of interfaces. // See also the Predefined Interfaces and Classes // // Interface list // * Countable // * OuterIterator // * RecursiveIterator // * SeekableIterator // * SplObserver // * SplSubject // // THE_COUNTABLE_INTERFACE - BEGIN // The Countable interface // // COUNTABLE_COUNT // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Classes implementing Countable can be used with the count() function. // // Interface synopsis // [code] // interface Countable { // // /* Methods */ // public count(): int // } // [/code] // // Table of Contents // * Countable::count - Count elements of an object // // COUNTABLE_COUNT - BEGIN // Countable::count // // ===== ABOUT // Count elements of an object // ===== DESCRIPTION // This method is executed when using the count() function on an object implementing Countable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public Countable::count(): int // ===== CODE // Parameters // This function has no parameters. // // Return Values // The custom count as an int. // Note: The return value is cast to an int. // // [examples] // Examples // [example] // Example #1 Countable::count() example // [php] // class myCounter implements Countable { // private $count = 0; // public function count() { // return ++$this->count; // } // } // // $counter = new myCounter; // // for($i=0; $i<10; ++$i) { // echo "I have been count()ed " . count($counter) . " times\n"; // } // [/php] // The above example will output something similar to: // [result] // I have been count()ed 1 times // I have been count()ed 2 times // I have been count()ed 3 times // I have been count()ed 4 times // I have been count()ed 5 times // I have been count()ed 6 times // I have been count()ed 7 times // I have been count()ed 8 times // I have been count()ed 9 times // I have been count()ed 10 times // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/countable.count.php // COUNTABLE_COUNT - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.countable.php // THE_COUNTABLE_INTERFACE - END // // THE_OUTERITERATOR_INTERFACE - BEGIN // The OuterIterator interface // // OUTERITERATOR_GETINNERITERATOR // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Classes implementing OuterIterator can be used to iterate over iterators. // // Interface synopsis // [code] // interface OuterIterator extends Iterator { // // /* Methods */ // public getInnerIterator(): ?Iterator // // /* Inherited methods */ // public Iterator::current(): mixed // public Iterator::key(): mixed // public Iterator::next(): void // public Iterator::rewind(): void // public Iterator::valid(): bool // } // [/code] // // Table of Contents // * OuterIterator::getInnerIterator - Returns the inner iterator for the current entry // // OUTERITERATOR_GETINNERITERATOR - BEGIN // OuterIterator::getInnerIterator // // ===== ABOUT // Returns the inner iterator for the current entry // ===== DESCRIPTION // Returns the inner iterator for the current iterator entry. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public OuterIterator::getInnerIterator(): ?Iterator // ===== CODE // Parameters // This function has no parameters. // // Return Values // Returns the inner iterator for the current entry if it exists, or null otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/outeriterator.getinneriterator.php // OUTERITERATOR_GETINNERITERATOR - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.outeriterator.php // THE_OUTERITERATOR_INTERFACE - END // // THE_RECURSIVEITERATOR_INTERFACE - BEGIN // The RecursiveIterator interface // // RECURSIVEITERATOR_GETCHILDREN // RECURSIVEITERATOR_HASCHILDREN // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Classes implementing RecursiveIterator can be used to iterate over iterators recursively. // // Interface synopsis // [code] // interface RecursiveIterator extends Iterator { // // /* Methods */ // public getChildren(): ?RecursiveIterator // public hasChildren(): bool // // /* Inherited methods */ // public Iterator::current(): mixed // public Iterator::key(): mixed // public Iterator::next(): void // public Iterator::rewind(): void // public Iterator::valid(): bool // } // [/code] // // Table of Contents // * RecursiveIterator::getChildren - Returns an iterator for the current entry // * RecursiveIterator::hasChildren - Returns if an iterator can be created for the current entry // // RECURSIVEITERATOR_GETCHILDREN - BEGIN // RecursiveIterator::getChildren // // ===== ABOUT // Returns an iterator for the current entry // ===== DESCRIPTION // Returns an iterator for the current iterator entry. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIterator::getChildren(): ?RecursiveIterator // ===== CODE // Parameters // This function has no parameters. // // Return Values // Returns an iterator for the current entry if it exists, or null otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiterator.getchildren.php // RECURSIVEITERATOR_GETCHILDREN - END // // RECURSIVEITERATOR_HASCHILDREN - BEGIN // RecursiveIterator::hasChildren // // ===== ABOUT // Returns if an iterator can be created for the current entry // ===== DESCRIPTION // Returns if an iterator can be created for the current entry. RecursiveIterator::getChildren(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIterator::hasChildren(): bool // ===== CODE // Parameters // This function has no parameters. // // Return Values // Returns true if the current entry can be iterated over, otherwise returns false. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiterator.haschildren.php // RECURSIVEITERATOR_HASCHILDREN - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.recursiveiterator.php // THE_RECURSIVEITERATOR_INTERFACE - END // // THE_SEEKABLEITERATOR_INTERFACE - BEGIN // The SeekableIterator interface // // SEEKABLEITERATOR_SEEK // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The Seekable iterator. // // Interface synopsis // [code] // interface SeekableIterator extends Iterator { // // /* Methods */ // public seek(int $offset): void // // /* Inherited methods */ // public Iterator::current(): mixed // public Iterator::key(): mixed // public Iterator::next(): void // public Iterator::rewind(): void // public Iterator::valid(): bool // } // [/code] // // [example] // Example #1 Basic usage // This example demonstrates creating a custom SeekableIterator, seeking to a position and handling an invalid position. // [php] // class MySeekableIterator implements SeekableIterator { // // private $position; // // private $array = array( // "first element", // "second element", // "third element", // "fourth element" // ); // // /* Method required for SeekableIterator interface */ // // public function seek($position) { // if (!isset($this->array[$position])) { // throw new OutOfBoundsException("invalid seek position ($position)"); // } // // $this->position = $position; // } // // /* Methods required for Iterator interface */ // // public function rewind() { // $this->position = 0; // } // // public function current() { // return $this->array[$this->position]; // } // // public function key() { // return $this->position; // } // // public function next() { // ++$this->position; // } // // public function valid() { // return isset($this->array[$this->position]); // } // // } // // try { // // $it = new MySeekableIterator; // echo $it->current(), "\n"; // // $it->seek(2); // echo $it->current(), "\n"; // // $it->seek(1); // echo $it->current(), "\n"; // // $it->seek(10); // // } catch (OutOfBoundsException $e) { // echo $e->getMessage(); // } // [/php] // The above example will output something similar to: // [result] // first element // third element // second element // invalid seek position (10) // [/result] // [/example] // // Table of Contents // * SeekableIterator::seek - Seeks to a position // // SEEKABLEITERATOR_SEEK - BEGIN // SeekableIterator::seek // // ===== ABOUT // Seeks to a position // ===== DESCRIPTION // Seeks to a given position in the iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SeekableIterator::seek(int $offset): void // ===== CODE // Parameters // int offset - The position to seek to. // // Return Values // No value is returned. // // Errors/Exceptions // Implementations should throw an OutOfBoundsException if the offset is not seekable. // // [examples] // Examples // [example] // Example #1 SeekableIterator::seek() example // Seek to the item at position 3 in the iterator (ArrayIterator implements SeekableIterator). // [php] // $array = array("apple", "banana", "cherry", "damson", "elderberry"); // $iterator = new ArrayIterator($array); // $iterator->seek(3); // echo $iterator->current(); // [/php] // The above example will output something similar to: // [result] // damson // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/seekableiterator.seek.php // SEEKABLEITERATOR_SEEK - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.seekableiterator.php // THE_SEEKABLEITERATOR_INTERFACE - END // // THE_SPLOBSERVER_INTERFACE - BEGIN // The SplObserver interface // // SPLOBSERVER_UPDATE // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The SplObserver interface is used alongside SplSubject to implement the Observer Design Pattern. // // Interface synopsis // [code] // interface SplObserver { // // /* Methods */ // public update(SplSubject $subject): void // } // [/code] // // Table of Contents // * SplObserver::update - Receive update from subject // // SPLOBSERVER_UPDATE - BEGIN // SplObserver::update // // ===== ABOUT // Receive update from subject // ===== DESCRIPTION // This method is called when any SplSubject to which the observer is attached calls SplSubject::notify(). // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObserver::update(SplSubject $subject): void // ===== CODE // SplSubject subject - The SplSubject notifying the observer of an update. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobserver.update.php // SPLOBSERVER_UPDATE - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splobserver.php // THE_SPLOBSERVER_INTERFACE - END // // THE_SPLSUBJECT_INTERFACE - BEGIN // The SplSubject interface // // SPLSUBJECT_ATTACH // SPLSUBJECT_DETACH // SPLSUBJECT_NOTIFY // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The SplSubject interface is used alongside SplObserver to implement the Observer Design Pattern. // // Interface synopsis // [code] // interface SplSubject { // // /* Methods */ // public attach(SplObserver $observer): void // public detach(SplObserver $observer): void // public notify(): void // } // [/code] // // Table of Contents // * SplSubject::attach - Attach an SplObserver // * SplSubject::detach - Detach an observer // * SplSubject::notify - Notify an observer // // SPLSUBJECT_ATTACH - BEGIN // SplSubject::attach // // ===== ABOUT // Attach an SplObserver // ===== DESCRIPTION // Attaches an SplObserver so that it can be notified of updates. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplSubject::attach(SplObserver $observer): void // ===== CODE // SplObserver observer - The SplObserver to attach. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splsubject.attach.php // SPLSUBJECT_ATTACH - END // // SPLSUBJECT_DETACH - BEGIN // SplSubject::detach // // ===== ABOUT // Detach an observer // ===== DESCRIPTION // Detaches an observer from the subject to no longer notify it of updates. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplSubject::detach(SplObserver $observer): void // ===== CODE // Parameters // SplObserver observer - The SplObserver to detach. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splsubject.detach.php // SPLSUBJECT_DETACH - END // // SPLSUBJECT_NOTIFY - BEGIN // SplSubject::notify // // ===== ABOUT // Notify an observer // ===== DESCRIPTION // Notifies all attached observers. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplSubject::notify(): void // ===== CODE // Parameters // This function has no parameters. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splsubject.notify.php // SPLSUBJECT_NOTIFY - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splsubject.php // THE_SPLSUBJECT_INTERFACE - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.interfaces.php // INTERFACES - END // // EXCEPTIONS - BEGIN // Exceptions // // THE_BADFUNCTIONCALLEXCEPTION_CLASS // THE_BADMETHODCALLEXCEPTION_CLASS // THE_DOMAINEXCEPTION_CLASS // THE_INVALIDARGUMENTEXCEPTION_CLASS // THE_LENGTHEXCEPTION_CLASS // THE_LOGICEXCEPTION_CLASS // THE_OUTOFBOUNDSEXCEPTION_CLASS // THE_OUTOFRANGEEXCEPTION_CLASS // THE_OVERFLOWEXCEPTION_CLASS // THE_RANGEEXCEPTION_CLASS // THE_RUNTIMEEXCEPTION_CLASS // THE_UNDERFLOWEXCEPTION_CLASS // THE_UNEXPECTEDVALUEEXCEPTION_CLASS // // Table of Contents // * BadFunctionCallException // * BadMethodCallException // * DomainException // * InvalidArgumentException // * LengthException // * LogicException // * OutOfBoundsException // * OutOfRangeException // * OverflowException // * RangeException // * RuntimeException // * UnderflowException // * UnexpectedValueException // // SPL provides a set of standard Exceptions. // See also the Predefined Exceptions // // SPL Exceptions Class Tree // * LogicException (extends Exception) // * BadFunctionCallException // * BadMethodCallException // * DomainException // * InvalidArgumentException // * LengthException // * OutOfRangeException // * RuntimeException (extends Exception) // * OutOfBoundsException // * OverflowException // * RangeException // * UnderflowException // * UnexpectedValueException // // THE_BADFUNCTIONCALLEXCEPTION_CLASS - BEGIN // The BadFunctionCallException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if a callback refers to an undefined function or if some arguments are missing. // // Class synopsis // [code] // class BadFunctionCallException extends LogicException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.badfunctioncallexception.php // THE_BADFUNCTIONCALLEXCEPTION_CLASS - END // // THE_BADMETHODCALLEXCEPTION_CLASS - BEGIN // The BadMethodCallException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if a callback refers to an undefined method or if some arguments are missing. // // Class synopsis // [code] // class BadMethodCallException extends BadFunctionCallException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.badmethodcallexception.php // THE_BADMETHODCALLEXCEPTION_CLASS - END // // THE_DOMAINEXCEPTION_CLASS - BEGIN // The DomainException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if a value does not adhere to a defined valid data domain. // // Class synopsis // [code] // class DomainException extends LogicException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.domainexception.php // THE_DOMAINEXCEPTION_CLASS - END // // THE_INVALIDARGUMENTEXCEPTION_CLASS - BEGIN // The InvalidArgumentException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if an argument is not of the expected type. // // Class synopsis // [code] // class InvalidArgumentException extends LogicException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.invalidargumentexception.php // THE_INVALIDARGUMENTEXCEPTION_CLASS - END // // THE_LENGTHEXCEPTION_CLASS - BEGIN // The LengthException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if a length is invalid. // // Class synopsis // [code] // class LengthException extends LogicException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.lengthexception.php // THE_LENGTHEXCEPTION_CLASS - END // // THE_LOGICEXCEPTION_CLASS - BEGIN // The LogicException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception that represents error in the program logic. This kind of exception should lead directly to a fix in your code. // // Class synopsis // [code] // class LogicException extends Exception { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.logicexception.php // THE_LOGICEXCEPTION_CLASS - END // // THE_OUTOFBOUNDSEXCEPTION_CLASS - BEGIN // The OutOfBoundsException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if a value is not a valid key. This represents errors that cannot be detected at compile time. // // Class synopsis // [code] // class OutOfBoundsException extends RuntimeException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.outofboundsexception.php // THE_OUTOFBOUNDSEXCEPTION_CLASS - END // // THE_OUTOFRANGEEXCEPTION_CLASS - BEGIN // The OutOfRangeException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown when an illegal index was requested. This represents errors that should be detected at compile time. // // Class synopsis // [code] // class OutOfRangeException extends LogicException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.outofrangeexception.php // THE_OUTOFRANGEEXCEPTION_CLASS - END // // THE_OVERFLOWEXCEPTION_CLASS - BEGIN // The OverflowException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown when adding an element to a full container. // // Class synopsis // [code] // class OverflowException extends RuntimeException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.overflowexception.php // THE_OVERFLOWEXCEPTION_CLASS - END // // THE_RANGEEXCEPTION_CLASS - BEGIN // The RangeException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown to indicate range errors during program execution. Normally this means there was an arithmetic error other than under/overflow. This is the runtime version of DomainException. // // Class synopsis // [code] // class RangeException extends RuntimeException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.rangeexception.php // THE_RANGEEXCEPTION_CLASS - END // // THE_RUNTIMEEXCEPTION_CLASS - BEGIN // The RuntimeException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if an error which can only be found on runtime occurs. // // Class synopsis // [code] // class RuntimeException extends Exception { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.runtimeexception.php // THE_RUNTIMEEXCEPTION_CLASS - END // // THE_UNDERFLOWEXCEPTION_CLASS - BEGIN // The UnderflowException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown when performing an invalid operation on an empty container, such as removing an element. // // Class synopsis // [code] // class UnderflowException extends RuntimeException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.underflowexception.php // THE_UNDERFLOWEXCEPTION_CLASS - END // // THE_UNEXPECTEDVALUEEXCEPTION_CLASS - BEGIN // The UnexpectedValueException class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Exception thrown if a value does not match with a set of values. Typically this happens when a function calls another function and expects the return value to be of a certain type or value not including arithmetic or buffer related errors. // // Class synopsis // [code] // class UnexpectedValueException extends RuntimeException { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Exception::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.unexpectedvalueexception.php // THE_UNEXPECTEDVALUEEXCEPTION_CLASS - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.exceptions.php // EXCEPTIONS - END // // SPL_FUNCTIONS - BEGIN // SPL Functions // // Table of Contents // * class_implements - Return the interfaces which are implemented by the given class or interface // * class_parents - Return the parent classes of the given class // * class_uses - Return the traits used by the given class // * iterator_apply - Call a function for every element in an iterator // * iterator_count - Count the elements in an iterator // * iterator_to_array - Copy the iterator into an array // * spl_autoload_call - Try all registered __autoload() functions to load the requested class // * spl_autoload_extensions - Register and return default file extensions for spl_autoload // * spl_autoload_functions - Return all registered __autoload() functions // * spl_autoload_register - Register given function as __autoload() implementation // * spl_autoload_unregister - Unregister given function as __autoload() implementation // * spl_autoload - Default implementation for __autoload() // * spl_classes - Return available SPL classes // * spl_object_hash - Return hash id for given object // * spl_object_id - Return the integer object handle for given object // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/ref.spl.php // SPL_FUNCTIONS - END // // FILE_HANDLING - BEGIN // File Handling // // THE_SPLFILEINFO_CLASS // THE_SPLFILEOBJECT_CLASS // THE_SPLTEMPFILEOBJECT_CLASS // // Table of Contents // * SplFileInfo // * SplFileObject // * SplTempFileObject // // SPL provides a number of classes to work with files. // // THE_SPLFILEINFO_CLASS - BEGIN // The SplFileInfo class // // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // // Introduction // The SplFileInfo class offers a high-level object-oriented interface to information for an individual file. // // Class synopsis // [code] // class SplFileInfo implements Stringable { // // /* Methods */ // public __construct(string $filename) // public getATime(): int|false // public getBasename(string $suffix = ""): string // public getCTime(): int|false // public getExtension(): string // public getFileInfo(?string $class = null): SplFileInfo // public getFilename(): string // public getGroup(): int|false // public getInode(): int|false // public getLinkTarget(): string|false // public getMTime(): int|false // public getOwner(): int|false // public getPath(): string // public getPathInfo(?string $class = null): ?SplFileInfo // public getPathname(): string // public getPerms(): int|false // public getRealPath(): string|false // public getSize(): int|false // public getType(): string|false // public isDir(): bool // public isExecutable(): bool // public isFile(): bool // public isLink(): bool // public isReadable(): bool // public isWritable(): bool // public openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public setFileClass(string $class = SplFileObject::class): void // public setInfoClass(string $class = SplFileInfo::class): void // public __toString(): string // } // [/code] // // Changelog // Version - Description // 8.0.0 - SplFileInfo implements Stringable now. // // Table of Contents // * SplFileInfo::__construct - Construct a new SplFileInfo object // * SplFileInfo::getATime - Gets last access time of the file // * SplFileInfo::getBasename - Gets the base name of the file // * SplFileInfo::getCTime - Gets the inode change time // * SplFileInfo::getExtension - Gets the file extension // * SplFileInfo::getFileInfo - Gets an SplFileInfo object for the file // * SplFileInfo::getFilename - Gets the filename // * SplFileInfo::getGroup - Gets the file group // * SplFileInfo::getInode - Gets the inode for the file // * SplFileInfo::getLinkTarget - Gets the target of a link // * SplFileInfo::getMTime - Gets the last modified time // * SplFileInfo::getOwner - Gets the owner of the file // * SplFileInfo::getPath - Gets the path without filename // * SplFileInfo::getPathInfo - Gets an SplFileInfo object for the path // * SplFileInfo::getPathname - Gets the path to the file // * SplFileInfo::getPerms - Gets file permissions // * SplFileInfo::getRealPath - Gets absolute path to file // * SplFileInfo::getSize - Gets file size // * SplFileInfo::getType - Gets file type // * SplFileInfo::isDir - Tells if the file is a directory // * SplFileInfo::isExecutable - Tells if the file is executable // * SplFileInfo::isFile - Tells if the object references a regular file // * SplFileInfo::isLink - Tells if the file is a link // * SplFileInfo::isReadable - Tells if file is readable // * SplFileInfo::isWritable - Tells if the entry is writable // * SplFileInfo::openFile - Gets an SplFileObject object for the file // * SplFileInfo::setFileClass - Sets the class used with SplFileInfo::openFile // * SplFileInfo::setInfoClass - Sets the class used with SplFileInfo::getFileInfo and SplFileInfo::getPathInfo // * SplFileInfo::__toString - Returns the path to the file as a string // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splfileinfo.php // THE_SPLFILEINFO_CLASS - END // // THE_SPLFILEOBJECT_CLASS - BEGIN // The SplFileObject class // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The SplFileObject class offers an object-oriented interface for a file. // // Class synopsis // [code] // class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator { // // /* Constants */ // public const int DROP_NEW_LINE; // public const int READ_AHEAD; // public const int SKIP_EMPTY; // public const int READ_CSV; // // /* Methods */ // public __construct( // string $filename, // string $mode = "r", // bool $useIncludePath = false, // ?resource $context = null // ) // public current(): string|array|false // public eof(): bool // public fflush(): bool // public fgetc(): string|false // public fgetcsv(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false // public fgets(): string // public fgetss(string $allowable_tags = ?): string // public flock(int $operation, int &$wouldBlock = null): bool // public fpassthru(): int // public fputcsv( // array $fields, // string $separator = ",", // string $enclosure = "\"", // string $escape = "\\", // string $eol = "\n" // ): int|false // public fread(int $length): string|false // public fscanf(string $format, mixed &...$vars): array|int|null // public fseek(int $offset, int $whence = SEEK_SET): int // public fstat(): array // public ftell(): int|false // public ftruncate(int $size): bool // public fwrite(string $data, int $length = 0): int|false // public getChildren(): null // public getCsvControl(): array // public getFlags(): int // public getMaxLineLen(): int // public hasChildren(): false // public key(): int // public next(): void // public rewind(): void // public seek(int $line): void // public setCsvControl(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): void // public setFlags(int $flags): void // public setMaxLineLen(int $maxLength): void // public __toString(): string // public valid(): bool // // /* Inherited methods */ // public SplFileInfo::getATime(): int|false // public SplFileInfo::getBasename(string $suffix = ""): string // public SplFileInfo::getCTime(): int|false // public SplFileInfo::getExtension(): string // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // public SplFileInfo::getFilename(): string // public SplFileInfo::getGroup(): int|false // public SplFileInfo::getInode(): int|false // public SplFileInfo::getLinkTarget(): string|false // public SplFileInfo::getMTime(): int|false // public SplFileInfo::getOwner(): int|false // public SplFileInfo::getPath(): string // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // public SplFileInfo::getPathname(): string // public SplFileInfo::getPerms(): int|false // public SplFileInfo::getRealPath(): string|false // public SplFileInfo::getSize(): int|false // public SplFileInfo::getType(): string|false // public SplFileInfo::isDir(): bool // public SplFileInfo::isExecutable(): bool // public SplFileInfo::isFile(): bool // public SplFileInfo::isLink(): bool // public SplFileInfo::isReadable(): bool // public SplFileInfo::isWritable(): bool // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // public SplFileInfo::__toString(): string // } // [/code] // // Predefined Constants // SplFileObject::DROP_NEW_LINE - Drop newlines at the end of a line. // SplFileObject::READ_AHEAD - Read on rewind/next. // SplFileObject::SKIP_EMPTY - Skips empty lines in the file. This requires the READ_AHEAD flag be enabled, to work as expected. // SplFileObject::READ_CSV - Read lines as CSV rows. // // Table of Contents // * SplFileObject::__construct - Construct a new file object // * SplFileObject::current - Retrieve current line of file // * SplFileObject::eof - Reached end of file // * SplFileObject::fflush - Flushes the output to the file // * SplFileObject::fgetc - Gets character from file // * SplFileObject::fgetcsv - Gets line from file and parse as CSV fields // * SplFileObject::fgets - Gets line from file // * SplFileObject::fgetss - Gets line from file and strip HTML tags // * SplFileObject::flock - Portable file locking // * SplFileObject::fpassthru - Output all remaining data on a file pointer // * SplFileObject::fputcsv - Write a field array as a CSV line // * SplFileObject::fread - Read from file // * SplFileObject::fscanf - Parses input from file according to a format // * SplFileObject::fseek - Seek to a position // * SplFileObject::fstat - Gets information about the file // * SplFileObject::ftell - Return current file position // * SplFileObject::ftruncate - Truncates the file to a given length // * SplFileObject::fwrite - Write to file // * SplFileObject::getChildren - No purpose // * SplFileObject::getCsvControl - Get the delimiter, enclosure and escape character for CSV // * SplFileObject::getCurrentLine - Alias of SplFileObject::fgets // * SplFileObject::getFlags - Gets flags for the SplFileObject // * SplFileObject::getMaxLineLen - Get maximum line length // * SplFileObject::hasChildren - SplFileObject does not have children // * SplFileObject::key - Get line number // * SplFileObject::next - Read next line // * SplFileObject::rewind - Rewind the file to the first line // * SplFileObject::seek - Seek to specified line // * SplFileObject::setCsvControl - Set the delimiter, enclosure and escape character for CSV // * SplFileObject::setFlags - Sets flags for the SplFileObject // * SplFileObject::setMaxLineLen - Set maximum line length // * SplFileObject::__toString - Returns the current line as a string // * SplFileObject::valid - Not at EOF // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splfileobject.php // THE_SPLFILEOBJECT_CLASS - END // // THE_SPLTEMPFILEOBJECT_CLASS - BEGIN // The SplTempFileObject class // // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // // Introduction // The SplTempFileObject class offers an object-oriented interface for a temporary file. // // Class synopsis // [code] // class SplTempFileObject extends SplFileObject { // // /* Inherited constants */ // public const int SplFileObject::DROP_NEW_LINE; // public const int SplFileObject::READ_AHEAD; // public const int SplFileObject::SKIP_EMPTY; // public const int SplFileObject::READ_CSV; // // /* Methods */ // public __construct(int $maxMemory = 2 * 1024 * 1024) // // /* Inherited methods */ // public SplFileObject::current(): string|array|false // public SplFileObject::eof(): bool // public SplFileObject::fflush(): bool // public SplFileObject::fgetc(): string|false // public SplFileObject::fgetcsv(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false // public SplFileObject::fgets(): string // public SplFileObject::fgetss(string $allowable_tags = ?): string // public SplFileObject::flock(int $operation, int &$wouldBlock = null): bool // public SplFileObject::fpassthru(): int // public SplFileObject::fputcsv( // array $fields, // string $separator = ",", // string $enclosure = "\"", // string $escape = "\\", // string $eol = "\n" // ): int|false // public SplFileObject::fread(int $length): string|false // public SplFileObject::fscanf(string $format, mixed &...$vars): array|int|null // public SplFileObject::fseek(int $offset, int $whence = SEEK_SET): int // public SplFileObject::fstat(): array // public SplFileObject::ftell(): int|false // public SplFileObject::ftruncate(int $size): bool // public SplFileObject::fwrite(string $data, int $length = 0): int|false // public SplFileObject::getChildren(): null // public SplFileObject::getCsvControl(): array // public SplFileObject::getFlags(): int // public SplFileObject::getMaxLineLen(): int // public SplFileObject::hasChildren(): false // public SplFileObject::key(): int // public SplFileObject::next(): void // public SplFileObject::rewind(): void // public SplFileObject::seek(int $line): void // public SplFileObject::setCsvControl(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): void // public SplFileObject::setFlags(int $flags): void // public SplFileObject::setMaxLineLen(int $maxLength): void // public SplFileObject::__toString(): string // public SplFileObject::valid(): bool // public SplFileInfo::getATime(): int|false // public SplFileInfo::getBasename(string $suffix = ""): string // public SplFileInfo::getCTime(): int|false // public SplFileInfo::getExtension(): string // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // public SplFileInfo::getFilename(): string // public SplFileInfo::getGroup(): int|false // public SplFileInfo::getInode(): int|false // public SplFileInfo::getLinkTarget(): string|false // public SplFileInfo::getMTime(): int|false // public SplFileInfo::getOwner(): int|false // public SplFileInfo::getPath(): string // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // public SplFileInfo::getPathname(): string // public SplFileInfo::getPerms(): int|false // public SplFileInfo::getRealPath(): string|false // public SplFileInfo::getSize(): int|false // public SplFileInfo::getType(): string|false // public SplFileInfo::isDir(): bool // public SplFileInfo::isExecutable(): bool // public SplFileInfo::isFile(): bool // public SplFileInfo::isLink(): bool // public SplFileInfo::isReadable(): bool // public SplFileInfo::isWritable(): bool // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // public SplFileInfo::__toString(): string // } // [/code] // // Table of Contents // * SplTempFileObject::__construct - Construct a new temporary file object // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.spltempfileobject.php // THE_SPLTEMPFILEOBJECT_CLASS - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.files.php // FILE_HANDLING - END // // MISCELLANEOUS_CLASSES_AND_INTERFACES - BEGIN // Miscellaneous Classes and Interfaces // // THE_ARRAYOBJECT_CLASS // THE_SPLOBSERVER_INTERFACE // THE_SPLSUBJECT_INTERFACE // // Table of Contents // * ArrayObject // * SplObserver // * SplSubject // // Classes and interfaces which do not fit into the other SPL categories. // // THE_ARRAYOBJECT_CLASS - BEGIN // The ArrayObject class // // PHP_5, PHP_7, PHP_8 // // Introduction // This class allows objects to work as arrays. // // Class synopsis // [code] // class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable { // // /* Constants */ // const int STD_PROP_LIST; // const int ARRAY_AS_PROPS; // // /* Methods */ // public __construct(array|object $array = [], int $flags = 0, string $iteratorClass = ArrayIterator::class) // public append(mixed $value): void // public asort(int $flags = SORT_REGULAR): true // public count(): int // public exchangeArray(array|object $array): array // public getArrayCopy(): array // public getFlags(): int // public getIterator(): Iterator // public getIteratorClass(): string // public ksort(int $flags = SORT_REGULAR): true // public natcasesort(): true // public natsort(): true // public offsetExists(mixed $key): bool // public offsetGet(mixed $key): mixed // public offsetSet(mixed $key, mixed $value): void // public offsetUnset(mixed $key): void // public serialize(): string // public setFlags(int $flags): void // public setIteratorClass(string $iteratorClass): void // public uasort(callable $callback): true // public uksort(callable $callback): true // public unserialize(string $data): void // } // [/code] // // Predefined Constants // // ArrayObject Flags // ArrayObject::STD_PROP_LIST - Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.). // ArrayObject::ARRAY_AS_PROPS - Entries can be accessed as properties (read and write). The ArrayObject class uses its own logic to access properties, thus no warning or error is raised when trying to read or write dynamic properties. // // Table of Contents // * ArrayObject::append - Appends the value // * ArrayObject::asort - Sort the entries by value // * ArrayObject::__construct - Construct a new array object // * ArrayObject::count - Get the number of public properties in the ArrayObject // * ArrayObject::exchangeArray - Exchange the array for another one // * ArrayObject::getArrayCopy - Creates a copy of the ArrayObject // * ArrayObject::getFlags - Gets the behavior flags // * ArrayObject::getIterator - Create a new iterator from an ArrayObject instance // * ArrayObject::getIteratorClass - Gets the iterator classname for the ArrayObject // * ArrayObject::ksort - Sort the entries by key // * ArrayObject::natcasesort - Sort an array using a case insensitive "natural order" algorithm // * ArrayObject::natsort - Sort entries using a "natural order" algorithm // * ArrayObject::offsetExists - Returns whether the requested index exists // * ArrayObject::offsetGet - Returns the value at the specified index // * ArrayObject::offsetSet - Sets the value at the specified index to newval // * ArrayObject::offsetUnset - Unsets the value at the specified index // * ArrayObject::serialize - Serialize an ArrayObject // * ArrayObject::setFlags - Sets the behavior flags // * ArrayObject::setIteratorClass - Sets the iterator classname for the ArrayObject // * ArrayObject::uasort - Sort the entries with a user-defined comparison function and maintain key association // * ArrayObject::uksort - Sort the entries by keys using a user-defined comparison function // * ArrayObject::unserialize - Unserialize an ArrayObject // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.arrayobject.php // THE_ARRAYOBJECT_CLASS - END // // THE_SPLOBSERVER_INTERFACE - BEGIN // The SplObserver interface // // SPLOBSERVER_UPDATE // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The SplObserver interface is used alongside SplSubject to implement the Observer Design Pattern. // // Interface synopsis // [code] // interface SplObserver { // // /* Methods */ // public update(SplSubject $subject): void // } // [/code] // // Table of Contents // * SplObserver::update - Receive update from subject // // SPLOBSERVER_UPDATE - BEGIN // SplObserver::update // // ===== ABOUT // Receive update from subject // ===== DESCRIPTION // This method is called when any SplSubject to which the observer is attached calls SplSubject::notify(). // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObserver::update(SplSubject $subject): void // ===== CODE // Parameters // SplSubject subject - The SplSubject notifying the observer of an update. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/splobserver.update.php // SPLOBSERVER_UPDATE - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splobserver.php // THE_SPLOBSERVER_INTERFACE - END // // THE_SPLSUBJECT_INTERFACE - BEGIN // The SplSubject interface // // SPLSUBJECT_ATTACH // SPLSUBJECT_DETACH // SPLSUBJECT_NOTIFY // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // The SplSubject interface is used alongside SplObserver to implement the Observer Design Pattern. // // Interface synopsis // [code] // interface SplSubject { // // /* Methods */ // public attach(SplObserver $observer): void // public detach(SplObserver $observer): void // public notify(): void // } // [/code] // // Table of Contents // * SplSubject::attach - Attach an SplObserver // * SplSubject::detach - Detach an observer // * SplSubject::notify - Notify an observer // // SPLSUBJECT_ATTACH - BEGIN // SplSubject::attach // // ===== ABOUT // Attach an SplObserver // ===== DESCRIPTION // Attaches an SplObserver so that it can be notified of updates. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplSubject::attach(SplObserver $observer): void // ===== CODE // Parameters // SplObserver observer - The SplObserver to attach. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/splsubject.attach.php // SPLSUBJECT_ATTACH - END // // SPLSUBJECT_DETACH - BEGIN // SplSubject::detach // // ===== ABOUT // Detach an observer // ===== DESCRIPTION // Detaches an observer from the subject to no longer notify it of updates. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplSubject::detach(SplObserver $observer): void // ===== CODE // Parameters // SplObserver observer - The SplObserver to detach. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/splsubject.detach.php // SPLSUBJECT_DETACH - END // // SPLSUBJECT_NOTIFY - BEGIN // SplSubject::notify // // ===== ABOUT // Notify an observer // ===== DESCRIPTION // Notifies all attached observers. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplSubject::notify(): void // ===== CODE // Parameters // This function has no parameters. // // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/splsubject.notify.php // SPLSUBJECT_NOTIFY - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/class.splsubject.php // THE_SPLSUBJECT_INTERFACE - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/spl.misc.php // MISCELLANEOUS_CLASSES_AND_INTERFACES - END // // LITERATURE_SOURCES // * PHP_NET (2023-10-21) // URL: https://www.php.net/manual/en/book.spl.php // STANDARD_PHP_LIBRARY_SPL - END // // LANGUAGE_REFERENCE_PREDEFINED_INTERFACES_AND_CLASSES - BEGIN // Predefined Interfaces and Classes (PHP Manual / Language Reference / Predefined Interfaces and Classes) // // THE_TRAVERSABLE_INTERFACE // THE_ITERATOR_INTERFACE // THE_ITERATORAGGREGATE_INTERFACE // THE_INTERNALITERATOR_CLASS // THROWABLE // THE_ARRAYACCESS_INTERFACE // THE_SERIALIZABLE_INTERFACE // THE_CLOSURE_CLASS // THE_STDCLASS_CLASS // THE_GENERATOR_CLASS // THE_FIBER_CLASS // THE_WEAKREFERENCE_CLASS // THE_WEAKMAP_CLASS // THE_STRINGABLE_INTERFACE // THE_UNITENUM_INTERFACE // THE_BACKEDENUM_INTERFACE // THE_SENSITIVEPARAMETERVALUE_CLASS // // Table of Contents // * Traversable // * Iterator // * IteratorAggregate // * InternalIterator // * Throwable // * ArrayAccess // * Serializable // * Closure // * stdClass // * Generator // * Fiber // * WeakReference // * WeakMap // * Stringable // * UnitEnum // * BackedEnum // * SensitiveParameterValue // // See also the SPL Interfaces and reserved classes. // // THE_TRAVERSABLE_INTERFACE - BEGIN // The Traversable interface // // PHP_5, PHP_7, PHP_8 // // Introduction // Interface to detect if a class is traversable using foreach. // Abstract base interface that cannot be implemented alone. Instead, it must be implemented by either IteratorAggregate or Iterator. // // Interface synopsis // [code] // interface Traversable { // } // [/code] // This interface has no methods, its only purpose is to be the base interface for all traversable classes. // // Changelog // Version - Description // 7.4.0 - The Traversable interface can now be implemented by abstract classes. Extending classes must implement Iterator or IteratorAggregate. // // Notes // Note: Internal (built-in) classes that implement this interface can be used in a foreach construct and do not need to implement IteratorAggregate or Iterator. // Note: Prior to PHP 7.4.0, this internal engine interface couldn't be implemented in PHP scripts. Either IteratorAggregate or Iterator must be used instead. // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.traversable.php // THE_TRAVERSABLE_INTERFACE - END // // THE_ITERATOR_INTERFACE - BEGIN // The Iterator interface // // PHP_5, PHP_7, PHP_8 // // Introduction // Interface for external iterators or objects that can be iterated themselves internally. // // Interface synopsis // [code] // interface Iterator extends Traversable { // // /* Methods */ // public current(): mixed // public key(): mixed // public next(): void // public rewind(): void // public valid(): bool // } // [/code] // // Predefined iterators // PHP already provides a number of iterators for many day to day tasks. See SPL iterators for a list. // // [examples] // Examples // [example] // Example #1 Basic usage // This example demonstrates in which order methods are called when using foreach with an iterator. // [php] // class myIterator implements Iterator { // private $position = 0; // private $array = array( // "firstelement", // "secondelement", // "lastelement", // ); // // public function __construct() { // $this->position = 0; // } // // public function rewind(): void { // var_dump(__METHOD__); // $this->position = 0; // } // // #[\ReturnTypeWillChange] // public function current() { // var_dump(__METHOD__); // return $this->array[$this->position]; // } // // #[\ReturnTypeWillChange] // public function key() { // var_dump(__METHOD__); // return $this->position; // } // // public function next(): void { // var_dump(__METHOD__); // ++$this->position; // } // // public function valid(): bool { // var_dump(__METHOD__); // return isset($this->array[$this->position]); // } // } // // $it = new myIterator; // // foreach($it as $key => $value) { // var_dump($key, $value); // echo "\n"; // } // [/php] // The above example will output something similar to: // [result] // string(18) "myIterator::rewind" // string(17) "myIterator::valid" // string(19) "myIterator::current" // string(15) "myIterator::key" // int(0) // string(12) "firstelement" // // string(16) "myIterator::next" // string(17) "myIterator::valid" // string(19) "myIterator::current" // string(15) "myIterator::key" // int(1) // string(13) "secondelement" // // string(16) "myIterator::next" // string(17) "myIterator::valid" // string(19) "myIterator::current" // string(15) "myIterator::key" // int(2) // string(11) "lastelement" // // string(16) "myIterator::next" // string(17) "myIterator::valid" // [/result] // [/example] // [/examples] // // Table of Contents // * Iterator::current - Return the current element // * Iterator::key - Return the key of the current element // * Iterator::next - Move forward to next element // * Iterator::rewind - Rewind the Iterator to the first element // * Iterator::valid - Checks if current position is valid // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.iterator.php // THE_ITERATOR_INTERFACE - END // // THE_ITERATORAGGREGATE_INTERFACE - BEGIN // The IteratorAggregate interface // // PHP_5, PHP_7, PHP_8 // // Introduction // Interface to create an external Iterator. // // Interface synopsis // [code] // interface IteratorAggregate extends Traversable { // // /* Methods */ // public getIterator(): Traversable // } // [/code] // // [example] // Example #1 Basic usage // [php] // class myData implements IteratorAggregate { // public $property1 = "Public property one"; // public $property2 = "Public property two"; // public $property3 = "Public property three"; // public $property4 = ""; // // public function __construct() { // $this->property4 = "last property"; // } // // public function getIterator(): Traversable { // return new ArrayIterator($this); // } // } // // $obj = new myData; // // foreach($obj as $key => $value) { // var_dump($key, $value); // echo "\n"; // } // [/php] // The above example will output something similar to: // [result] // string(9) "property1" // string(19) "Public property one" // // string(9) "property2" // string(19) "Public property two" // // string(9) "property3" // string(21) "Public property three" // // string(9) "property4" // string(13) "last property" // [/result] // [/example] // // Table of Contents // * IteratorAggregate::getIterator - Retrieve an external iterator // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.iteratoraggregate.php // THE_ITERATORAGGREGATE_INTERFACE - END // // THE_INTERNALITERATOR_CLASS - BEGIN // The InternalIterator class // // PHP_8 // // Introduction // Class to ease implementing IteratorAggregate for internal classes. // // Class synopsis // [code] // final class InternalIterator implements Iterator { // // /* Methods */ // private __construct() // public current(): mixed // public key(): mixed // public next(): void // public rewind(): void // public valid(): bool // } // [/code] // // Table of Contents // * InternalIterator::__construct - Private constructor to disallow direct instantiation // * InternalIterator::current - Return the current element // * InternalIterator::key - Return the key of the current element // * InternalIterator::next - Move forward to next element // * InternalIterator::rewind - Rewind the Iterator to the first element // * InternalIterator::valid - Check if current position is valid // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.internaliterator.php // THE_INTERNALITERATOR_CLASS - END // // THROWABLE - BEGIN // Throwable // // PHP_7, PHP_8 // // Introduction // Throwable is the base interface for any object that can be thrown via a throw statement, including Error and Exception. // Note: PHP classes cannot implement the Throwable interface directly, and must instead extend Exception. // // Interface synopsis // [code] // interface Throwable extends Stringable { // // /* Methods */ // public getMessage(): string // public getCode(): int // public getFile(): string // public getLine(): int // public getTrace(): array // public getTraceAsString(): string // public getPrevious(): ?Throwable // public __toString(): string // // /* Inherited methods */ // public Stringable::__toString(): string // } // [/code] // // Changelog // Version - Description // 8.0.0 - Throwable implements Stringable now. // // Table of Contents // * Throwable::getMessage - Gets the message // * Throwable::getCode - Gets the exception code // * Throwable::getFile - Gets the file in which the object was created // * Throwable::getLine - Gets the line on which the object was instantiated // * Throwable::getTrace - Gets the stack trace // * Throwable::getTraceAsString - Gets the stack trace as a string // * Throwable::getPrevious - Returns the previous Throwable // * Throwable::__toString - Gets a string representation of the thrown object // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.throwable.php // THROWABLE - END // // THE_ARRAYACCESS_INTERFACE - BEGIN // The ArrayAccess interface // // PHP_5, PHP_7, PHP_8 // // Introduction // Interface to provide accessing objects as arrays. // // Interface synopsis // [code] // interface ArrayAccess { // // /* Methods */ // public offsetExists(mixed $offset): bool // public offsetGet(mixed $offset): mixed // public offsetSet(mixed $offset, mixed $value): void // public offsetUnset(mixed $offset): void // } // [/code] // // [example] // Example #1 Basic usage // [php] // class Obj implements ArrayAccess { // public $container = [ // "one" => 1, // "two" => 2, // "three" => 3, // ]; // // public function offsetSet($offset, $value): void { // if (is_null($offset)) { // $this->container[] = $value; // } else { // $this->container[$offset] = $value; // } // } // // public function offsetExists($offset): bool { // return isset($this->container[$offset]); // } // // public function offsetUnset($offset): void { // unset($this->container[$offset]); // } // // public function offsetGet($offset): mixed { // return isset($this->container[$offset]) ? $this->container[$offset] : null; // } // } // // $obj = new Obj; // // var_dump(isset($obj["two"])); // var_dump($obj["two"]); // unset($obj["two"]); // var_dump(isset($obj["two"])); // $obj["two"] = "A value"; // var_dump($obj["two"]); // $obj[] = 'Append 1'; // $obj[] = 'Append 2'; // $obj[] = 'Append 3'; // print_r($obj); // [/php] // The above example will output something similar to: // [result] // bool(true) // int(2) // bool(false) // string(7) "A value" // obj Object // ( // [container:obj:private] => Array // ( // [one] => 1 // [three] => 3 // [two] => A value // [0] => Append 1 // [1] => Append 2 // [2] => Append 3 // ) // ) // [/result] // [/example] // // Table of Contents // * ArrayAccess::offsetExists - Whether an offset exists // * ArrayAccess::offsetGet - Offset to retrieve // * ArrayAccess::offsetSet - Assign a value to the specified offset // * ArrayAccess::offsetUnset - Unset an offset // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.arrayaccess.php // THE_ARRAYACCESS_INTERFACE - END // // THE_SERIALIZABLE_INTERFACE - BEGIN // The Serializable interface // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // Interface for customized serializing. // Classes that implement this interface no longer support __sleep() and __wakeup(). The method serialize is called whenever an instance needs to be serialized. This does not invoke __destruct() or have any other side effect unless programmed inside the method. When the data is unserialized the class is known and the appropriate unserialize() method is called as a constructor instead of calling __construct(). If you need to execute the standard constructor you may do so in the method. // Warning: As of PHP 8.1.0, a class which implements Serializable without also implementing __serialize() and __unserialize() will generate a deprecation warning. // // Interface synopsis // [code] // interface Serializable { // // /* Methods */ // public serialize(): ?string // public unserialize(string $data): void // } // [/code] // // [example] // Example #1 Basic usage // [php] // class obj implements Serializable { // private $data; // public function __construct() { // $this->data = "My private data"; // } // public function serialize() { // return serialize($this->data); // } // public function unserialize($data) { // $this->data = unserialize($data); // } // public function getData() { // return $this->data; // } // } // // $obj = new obj; // $ser = serialize($obj); // // var_dump($ser); // // $newobj = unserialize($ser); // // var_dump($newobj->getData()); // [/php] // The above example will output something similar to: // [result] // string(38) "C:3:"obj":23:{s:15:"My private data";}" // string(15) "My private data" // [/result] // [/example] // // Table of Contents // * Serializable::serialize - String representation of object // * Serializable::unserialize - Constructs the object // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.serializable.php // THE_SERIALIZABLE_INTERFACE - END // // THE_CLOSURE_CLASS - BEGIN // The Closure class // // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // // Introduction // Class used to represent anonymous functions. // Anonymous functions yield objects of this type. This class has methods that allow further control of the anonymous function after it has been created. // Besides the methods listed here, this class also has an __invoke method. This is for consistency with other classes that implement calling magic, as this method is not used for calling the function. // // Class synopsis // [code] // final class Closure { // // /* Methods */ // private __construct() // public static bind(Closure $closure, ?object $newThis, object|string|null $newScope = "static"): ?Closure // public bindTo(?object $newThis, object|string|null $newScope = "static"): ?Closure // public call(object $newThis, mixed ...$args): mixed // public static fromCallable(callable $callback): Closure // } // [/code] // // Table of Contents // * Closure::__construct - Constructor that disallows instantiation // * Closure::bind - Duplicates a closure with a specific bound object and class scope // * Closure::bindTo - Duplicates the closure with a new bound object and class scope // * Closure::call - Binds and calls the closure // * Closure::fromCallable - Converts a callable into a closure // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.closure.php // THE_CLOSURE_CLASS - END // // THE_STDCLASS_CLASS - BEGIN // The stdClass class // // PHP_4, PHP_5, PHP_7, PHP_8 // // Introduction // A generic empty class with dynamic properties. // Objects of this class can be instantiated with new operator or created by typecasting to object. Several PHP functions also create instances of this class, e.g. json_decode(), mysqli_fetch_object() or PDOStatement::fetchObject(). // Despite not implementing __get()/__set() magic methods, this class allows dynamic properties and does not require the #[\AllowDynamicProperties] attribute. // This is not a base class as PHP does not have a concept of a universal base class. However, it is possible to create a custom class that extends from stdClass and as a result inherits the functionality of dynamic properties. // // Class synopsis // [code] // class stdClass { // } // [/code] // This class has no methods or default properties. // // [examples] // Examples // [example] // Example #1 Created as a result of typecasting to object // [php] // $obj = (object) array('foo' => 'bar'); // var_dump($obj); // [/php] // The above example will output: // [result] // object(stdClass)#1 (1) { // ["foo"]=> // string(3) "bar" // } // [/result] // [/example] // [example] // Example #2 Created as a result of json_decode() // [php] // $json = '{"foo":"bar"}'; // var_dump(json_decode($json)); // [/php] // The above example will output: // [result] // object(stdClass)#1 (1) { // ["foo"]=> // string(3) "bar" // } // [/result] // [/example] // [example] // Example #3 Declaring dynamic properties // [php] // $obj = new stdClass(); // $obj->foo = 42; // $obj->{1} = 42; // var_dump($obj); // [/php] // The above example will output: // [result] // object(stdClass)#1 (2) { // ["foo"]=> // int(42) // ["1"]=> // int(42) // } // [/result] // [/example] // [/examples] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.stdclass.php // THE_STDCLASS_CLASS - END // // THE_GENERATOR_CLASS - BEGIN // The Generator class // // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // // Introduction // Generator objects are returned from generators. // Caution: Generator objects cannot be instantiated via new. // // Class synopsis // [code] // final class Generator implements Iterator { // // /* Methods */ // public current(): mixed // public getReturn(): mixed // public key(): mixed // public next(): void // public rewind(): void // public send(mixed $value): mixed // public throw(Throwable $exception): mixed // public valid(): bool // public __wakeup(): void // } // [/code] // // See Also // See also object iteration. // // Table of Contents // * Generator::current - Get the yielded value // * Generator::getReturn - Get the return value of a generator // * Generator::key - Get the yielded key // * Generator::next - Resume execution of the generator // * Generator::rewind - Rewind the iterator // * Generator::send - Send a value to the generator // * Generator::throw - Throw an exception into the generator // * Generator::valid - Check if the iterator has been closed // * Generator::__wakeup - Serialize callback // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.generator.php // THE_GENERATOR_CLASS - END // // THE_FIBER_CLASS - BEGIN // The Fiber class // // PHP_8 >= PHP_8_1_0 // // Introduction // Fibers represent full-stack, interruptible functions. Fibers may be suspended from anywhere in the call-stack, pausing execution within the fiber until the fiber is resumed at a later time. // // Class synopsis // [code] // final class Fiber { // // /* Methods */ // public __construct(callable $callback) // public start(mixed ...$args): mixed // public resume(mixed $value = null): mixed // public throw(Throwable $exception): mixed // public getReturn(): mixed // public isStarted(): bool // public isSuspended(): bool // public isRunning(): bool // public isTerminated(): bool // public static suspend(mixed $value = null): mixed // public static getCurrent(): ?Fiber // } // [/code] // // See Also // Fibers overview // // Table of Contents // * Fiber::__construct - Creates a new Fiber instance // * Fiber::start - Start execution of the fiber // * Fiber::resume - Resumes execution of the fiber with a value // * Fiber::throw - Resumes execution of the fiber with an exception // * Fiber::getReturn - Gets the value returned by the Fiber // * Fiber::isStarted - Determines if the fiber has started // * Fiber::isSuspended - Determines if the fiber is suspended // * Fiber::isRunning - Determines if the fiber is running // * Fiber::isTerminated - Determines if the fiber has terminated // * Fiber::suspend - Suspends execution of the current fiber // * Fiber::getCurrent - Gets the currently executing Fiber instance // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.fiber.php // THE_FIBER_CLASS - END // // THE_WEAKREFERENCE_CLASS - BEGIN // The WeakReference class // // PHP_7 >= PHP_7_4_0, PHP_8 // // Introduction // Weak references allow the programmer to retain a reference to an object which does not prevent the object from being destroyed. They are useful for implementing cache like structures. // WeakReferences cannot be serialized. // // Class synopsis // [code] // final class WeakReference { // // /* Methods */ // public __construct() // public static create(object $object): WeakReference // public get(): ?object // } // [/code] // // [examples] // WeakReference Examples // [example] // Example #1 Basic WeakReference Usage // [php] // $obj = new stdClass; // $weakref = WeakReference::create($obj); // var_dump($weakref->get()); // unset($obj); // var_dump($weakref->get()); // [/php] // The above example will output something similar to: // [result] // object(stdClass)#1 (0) { // } // NULL // [/result] // [/example] // [/examples] // // Table of Contents // * WeakReference::__construct - Constructor that disallows instantiation // * WeakReference::create - Create a new weak reference // * WeakReference::get - Get a weakly referenced Object // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.weakreference.php // THE_WEAKREFERENCE_CLASS - END // // THE_WEAKMAP_CLASS - BEGIN // The WeakMap class // // PHP_8 // // Introduction // A WeakMap is map (or dictionary) that accepts objects as keys. However, unlike the otherwise similar SplObjectStorage, an object in a key of WeakMap does not contribute toward the object's reference count. That is, if at any point the only remaining reference to an object is the key of a WeakMap, the object will be garbage collected and removed from the WeakMap. Its primary use case is for building caches of data derived from an object that do not need to live longer than the object. // WeakMap implements ArrayAccess, Iterator, and Countable, so in most cases it can be used in the same fashion as an associative array. // // Class synopsis // [code] // final class WeakMap implements ArrayAccess, Countable, IteratorAggregate { // // /* Methods */ // public count(): int // public getIterator(): Iterator // public offsetExists(object $object): bool // public offsetGet(object $object): mixed // public offsetSet(object $object, mixed $value): void // public offsetUnset(object $object): void // } // [/code] // // [examples] // Examples // [example] // Example #1 Weakmap usage example // [php] // $wm = new WeakMap(); // // $o = new stdClass; // // class A { // public function __destruct() { // echo "Dead!\n"; // } // } // // $wm[$o] = new A; // // var_dump(count($wm)); // echo "Unsetting...\n"; // unset($o); // echo "Done\n"; // var_dump(count($wm)); // [/php] // The above example will output: // [result] // int(1) // Unsetting... // Dead! // Done // int(0) // [/result] // [/example] // [/examples] // // Table of Contents // * WeakMap::count - Counts the number of live entries in the map // * WeakMap::getIterator - Retrieve an external iterator // * WeakMap::offsetExists - Checks whether a certain object is in the map // * WeakMap::offsetGet - Returns the value pointed to by a certain object // * WeakMap::offsetSet - Updates the map with a new key-value pair // * WeakMap::offsetUnset - Removes an entry from the map // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.weakmap.php // THE_WEAKMAP_CLASS - END // // THE_STRINGABLE_INTERFACE - BEGIN // The Stringable interface // // PHP_8 // // Introduction // The Stringable interface denotes a class as having a __toString() method. Unlike most interfaces, Stringable is implicitly present on any class that has the magic __toString() method defined, although it can and should be declared explicitly. // Its primary value is to allow functions to type check against the union type string|Stringable to accept either a string primitive or an object that can be cast to a string. // // Interface synopsis // [code] // interface Stringable { // // /* Methods */ // public __toString(): string // } // [/code] // // [examples] // Stringable Examples // [example] // Example #1 Basic Stringable Usage // [php] // class IPv4Address implements Stringable { // private string $oct1; // private string $oct2; // private string $oct3; // private string $oct4; // // public function __construct(string $oct1, string $oct2, string $oct3, string $oct4) { // $this->oct1 = $oct1; // $this->oct2 = $oct2; // $this->oct3 = $oct3; // $this->oct4 = $oct4; // } // // public function __toString(): string { // return "$this->oct1.$this->oct2.$this->oct3.$this->oct4"; // } // } // // function showStuff(string|Stringable $value) { // // A Stringable will get converted to a string here by calling // // __toString. // print $value; // } // // $ip = new IPv4Address('123', '234', '42', '9'); // // showStuff($ip); // [/php] // The above example will output something similar to: // [result] // 123.234.42.9 // [/result] // [/example] // [/examples] // // Table of Contents // * Stringable::__toString - Gets a string representation of the object // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.stringable.php // THE_STRINGABLE_INTERFACE - END // // THE_UNITENUM_INTERFACE - BEGIN // The UnitEnum interface // // PHP_8 >= PHP_8_1_0 // // Introduction // The UnitEnum interface is automatically applied to all enumerations by the engine. It may not be implemented by user-defined classes. Enumerations may not override its methods, as default implementations are provided by the engine. It is available only for type checks. // // Interface synopsis // [code] // interface UnitEnum { // // /* Methods */ // public static cases(): array // } // [/code] // // Table of Contents // * UnitEnum::cases - Generates a list of cases on an enum // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.unitenum.php // THE_UNITENUM_INTERFACE - END // // THE_BACKEDENUM_INTERFACE - BEGIN // The BackedEnum interface // // PHP_8 >= PHP_8_1_0 // // Introduction // The BackedEnum interface is automatically applied to backed enumerations by the engine. It may not be implemented by user-defined classes. Enumerations may not override its methods, as default implementations are provided by the engine. It is available only for type checks. // // Interface synopsis // [code] // interface BackedEnum extends UnitEnum { // // /* Methods */ // public static from(int|string $value): static // public static tryFrom(int|string $value): ?static // // /* Inherited methods */ // public static UnitEnum::cases(): array // } // [/code] // // Table of Contents // * BackedEnum::from - Maps a scalar to an enum instance // * BackedEnum::tryFrom - Maps a scalar to an enum instance or null // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.backedenum.php // THE_BACKEDENUM_INTERFACE - END // // THE_SENSITIVEPARAMETERVALUE_CLASS - BEGIN // The SensitiveParameterValue class // // PHP_8 >= PHP_8_2_0 // // Introduction // The SensitiveParameterValue class allows wrapping sensitive values to protect them against accidental exposure. // Values of parameters having the SensitiveParameter attribute will automatically be wrapped inside of a SensitiveParameterValue object within stack traces. // // Class synopsis // [code] // final class SensitiveParameterValue { // // /* Properties */ // private readonly mixed $value; // // /* Methods */ // public __construct(mixed $value) // public __debugInfo(): array // public getValue(): mixed // } // [/code] // // Properties // value - The sensitive value to be protected against accidental exposure. // // Table of Contents // * SensitiveParameterValue::__construct - Constructs a new SensitiveParameterValue object // * SensitiveParameterValue::__debugInfo - Protects the sensitive value against accidental exposure // * SensitiveParameterValue::getValue - Returns the sensitive value // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.sensitiveparametervalue.php // THE_SENSITIVEPARAMETERVALUE_CLASS - END // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/reserved.interfaces.php // LANGUAGE_REFERENCE_PREDEFINED_INTERFACES_AND_CLASSES - END // // LANGUAGE_REFERENCE_PREDEFINED_EXCEPTIONS - BEGIN // Predefined Exceptions (PHP Manual / Language Reference / Predefined Exceptions) // // EXCEPTION // ERROREXCEPTION // ERROR // ARGUMENTCOUNTERROR // ARITHMETICERROR // ASSERTIONERROR // DIVISIONBYZEROERROR // COMPILEERROR // PARSEERROR // TYPEERROR // VALUEERROR // UNHANDLEDMATCHERROR // FIBERERROR // // Table of Contents // * Exception // * ErrorException // * Error // * ArgumentCountError // * ArithmeticError // * AssertionError // * DivisionByZeroError // * CompileError // * ParseError // * TypeError // * ValueError // * UnhandledMatchError // * FiberError // // See also the SPL Exceptions // // EXCEPTION - BEGIN // Exception // // PHP_5, PHP_7, PHP_8 // // Introduction // Exception is the base class for all user exceptions. // // Class synopsis // [code] // class Exception implements Throwable { // // /* Properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Methods */ // public __construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public getMessage(): string // final public getPrevious(): ?Throwable // final public getCode(): int // final public getFile(): string // final public getLine(): int // final public getTrace(): array // final public getTraceAsString(): string // public __toString(): string // private __clone(): void // } // // Properties // message - The exception message // code - The exception code // file - The filename where the exception was created // line - The line where the exception was created // previous - The previously thrown exception // string - The string representation of the stack trace // trace - The stack trace as an array // // Table of Contents // * Exception::__construct - Construct the exception // * Exception::getMessage - Gets the Exception message // * Exception::getPrevious - Returns previous Throwable // * Exception::getCode - Gets the Exception code // * Exception::getFile - Gets the file in which the exception was created // * Exception::getLine - Gets the line in which the exception was created // * Exception::getTrace - Gets the stack trace // * Exception::getTraceAsString - Gets the stack trace as a string // * Exception::__toString - String representation of the exception // * Exception::__clone - Clone the exception // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.exception.php // EXCEPTION - END // // ERROREXCEPTION - BEGIN // ErrorException // // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // // Introduction // An Error Exception. // // Class synopsis // [code] // class ErrorException extends Exception { // // /* Properties */ // protected int $severity = E_ERROR; // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Methods */ // public __construct( // string $message = "", // int $code = 0, // int $severity = E_ERROR, // ?string $filename = null, // ?int $line = null, // ?Throwable $previous = null // ) // final public getSeverity(): int // // /* Inherited methods */ // final public Exception::getMessage(): string // final public Exception::getPrevious(): ?Throwable // final public Exception::getCode(): int // final public Exception::getFile(): string // final public Exception::getLine(): int // final public Exception::getTrace(): array // final public Exception::getTraceAsString(): string // public Exception::__toString(): string // private Exception::__clone(): void // } // [/code] // // Properties // severity - The severity of the exception // // [examples] // Examples // [example] // Example #1 Use set_error_handler() to change error messages into ErrorException. // [php] // function exception_error_handler(int $errno, string $errstr, string $errfile = null, int $errline) { // if (!(error_reporting() & $errno)) { // // This error code is not included in error_reporting // return; // } // throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); // } // set_error_handler(exception_error_handler(...)); // // Prior to PHP 8.1.0 and the introduction of the first class callable syntax, the following call must be used instead // // set_error_handler(__NAMESPACE__ . "\\exception_error_handler"); // // /* Trigger exception */ // strpos(); // [/php] // The above example will output something similar to: // [result] // Fatal error: Uncaught exception 'ErrorException' with message 'strpos() expects at least 2 parameters, 0 given' in /home/bjori/tmp/ex.php:12 // Stack trace: // #0 [internal function]: exception_error_handler(2, 'strpos() expect...', '/home/bjori/php...', 12, Array) // #1 /home/bjori/php/cleandocs/test.php(12): strpos() // #2 {main} // thrown in /home/bjori/tmp/ex.php on line 12 // [/result] // [/example] // [/examples] // // Table of Contents // * ErrorException::__construct - Constructs the exception // * ErrorException::getSeverity - Gets the exception severity // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.errorexception.php // ERROREXCEPTION - END // // ERROR - BEGIN // Error // // PHP_7, PHP_8 // // Introduction // Error is the base class for all internal PHP errors. // // Class synopsis // [code] // class Error implements Throwable { // // /* Properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Methods */ // public __construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public getMessage(): string // final public getPrevious(): ?Throwable // final public getCode(): int // final public getFile(): string // final public getLine(): int // final public getTrace(): array // final public getTraceAsString(): string // public __toString(): string // private __clone(): void // } // [/code] // // Properties // message - The error message // code - The error code // file - The filename where the error happened // line - The line where the error happened // previous - The previously thrown exception // string - The string representation of the stack trace // trace - The stack trace as an array // // Table of Contents // * Error::__construct - Construct the error object // * Error::getMessage - Gets the error message // * Error::getPrevious - Returns previous Throwable // * Error::getCode - Gets the error code // * Error::getFile - Gets the file in which the error occurred // * Error::getLine - Gets the line in which the error occurred // * Error::getTrace - Gets the stack trace // * Error::getTraceAsString - Gets the stack trace as a string // * Error::__toString - String representation of the error // * Error::__clone - Clone the error // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.error.php // ERROR - END // // ARGUMENTCOUNTERROR - BEGIN // ArgumentCountError // // PHP_7 >= PHP_7_1_0, PHP_8 // // Introduction // ArgumentCountError is thrown when too few arguments are passed to a user-defined function or method. // This error is also thrown when too many arguments are passed to a non-variadic built-in function. // // Class synopsis // [code] // class ArgumentCountError extends TypeError { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.argumentcounterror.php // ARGUMENTCOUNTERROR - END // // ARITHMETICERROR - BEGIN // ArithmeticError // // PHP_7, PHP_8 // // Introduction // ArithmeticError is thrown when an error occurs while performing mathematical operations. These errors include attempting to perform a bitshift by a negative amount, and any call to intdiv() that would result in a value outside the possible bounds of an int. // // Class synopsis // [code] // class ArithmeticError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.arithmeticerror.php // ARITHMETICERROR - END // // ASSERTIONERROR - BEGIN // AssertionError // // PHP_7, PHP_8 // // Introduction // AssertionError is thrown when an assertion made via assert() fails. // // Class synopsis // [code] // class AssertionError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.assertionerror.php // ASSERTIONERROR - END // // DIVISIONBYZEROERROR - BEGIN // DivisionByZeroError // // PHP_7, PHP_8 // // Introduction // DivisionByZeroError is thrown when an attempt is made to divide a number by zero. // // Class synopsis // [code] // class DivisionByZeroError extends ArithmeticError { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.divisionbyzeroerror.php // DIVISIONBYZEROERROR - END // // COMPILEERROR - BEGIN // CompileError // // PHP_7 > PHP_7_3_0, PHP_8 // // Introduction // CompileError is thrown for some compilation errors, which formerly issued a fatal error. // // Class synopsis // [code] // class CompileError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.compileerror.php // COMPILEERROR - END // // PARSEERROR - BEGIN // ParseError // // PHP_7, PHP_8 // // Introduction // ParseError is thrown when an error occurs while parsing PHP code, such as when eval() is called. // Note: ParseError extends CompileError as of PHP 7.3.0. Formerly, it extended Error. // // Class synopsis // [code] // class ParseError extends CompileError { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.parseerror.php // PARSEERROR - END // // TYPEERROR - BEGIN // TypeError // // PHP_7, PHP_8 // // Introduction // A TypeError may be thrown when: // * The value being set for a class property does not match the property's corresponding declared type. // * The argument type being passed to a function does not match its corresponding declared parameter type. // * A value being returned from a function does not match the declared function return type. // // Class synopsis // [code] // class TypeError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // Changelog // Version - Description // 7.1.0 - A TypeError is no longer thrown when an invalid number of arguments are passed to a built-in PHP function in strict mode. Instead, an ArgumentCountError is raised. // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.typeerror.php // TYPEERROR - END // // VALUEERROR - BEGIN // ValueError // // PHP_8 // // Introduction // A ValueError is thrown when the type of an argument is correct but the value of it is incorrect. For example, passing a negative integer when the function expects a positive one, or passing an empty string/array when the function expects it to not be empty. // // Class synopsis // [code] // class ValueError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.valueerror.php // VALUEERROR - END // // UNHANDLEDMATCHERROR - BEGIN // UnhandledMatchError // // PHP_8 // // Introduction // An UnhandledMatchError is thrown when the subject passed to a match expression is not handled by any arm of the match expression. // // Class synopsis // [code] // class UnhandledMatchError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Inherited methods */ // public Error::__construct(string $message = "", int $code = 0, ?Throwable $previous = null) // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.unhandledmatcherror.php // UNHANDLEDMATCHERROR - END // // FIBERERROR - BEGIN // FiberError // // PHP_8 >= PHP_8_1_0 // // Introduction // FiberError is thrown when an invalid operation is performed on a Fiber. // // Class synopsis // [code] // final class FiberError extends Error { // // /* Inherited properties */ // protected string $message = ""; // private string $string = ""; // protected int $code; // protected string $file = ""; // protected int $line; // private array $trace = []; // private ?Throwable $previous = null; // // /* Methods */ // public __construct() // // /* Inherited methods */ // final public Error::getMessage(): string // final public Error::getPrevious(): ?Throwable // final public Error::getCode(): int // final public Error::getFile(): string // final public Error::getLine(): int // final public Error::getTrace(): array // final public Error::getTraceAsString(): string // public Error::__toString(): string // private Error::__clone(): void // } // [/code] // // Table of Contents // * FiberError::__construct - Constructor to disallow direct instantiation // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/class.fibererror.php // FIBERERROR - END // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/reserved.exceptions.php // LANGUAGE_REFERENCE_PREDEFINED_EXCEPTIONS - END // // LANGUAGE_REFERENCE_FIBERS - BEGIN // Fibers (PHP Manual / Language Reference / Fibers) // // Fibers overview // // PHP_8 >= PHP_8_1_0 // // Fibers represent full-stack, interruptible functions. Fibers may be suspended from anywhere in the call-stack, pausing execution within the fiber until the fiber is resumed at a later time. // Fibers pause the entire execution stack, so the direct caller of the function does not need to change how it invokes the function. // Execution may be interrupted anywhere in the call stack using Fiber::suspend() (that is, the call to Fiber::suspend() may be in a deeply nested function or not even exist at all). // Unlike stack-less Generators, each Fiber has its own call stack, allowing them to be paused within deeply nested function calls. A function declaring an interruption point (that is, calling Fiber::suspend()) need not change its return type, unlike a function using yield which must return a Generator instance. // Fibers can be suspended in any function call, including those called from within the PHP VM, such as functions provided to array_map() or methods called by foreach on an Iterator object. // Once suspended, execution of the fiber may be resumed with any value using Fiber::resume() or by throwing an exception into the fiber using Fiber::throw(). The value is returned (or exception thrown) from Fiber::suspend(). // Note: Due to current limitations it is not possible to switch fibers in the destructor of an object. // // [example] // Example #1 Basic usage // [php] // $fiber = new Fiber(function (): void { // $value = Fiber::suspend('fiber'); // echo "Value used to resume fiber: ", $value, PHP_EOL; // }); // // $value = $fiber->start(); // // echo "Value from fiber suspending: ", $value, PHP_EOL; // // $fiber->resume('test'); // [/php] // The above example will output: // [result] // Value from fiber suspending: fiber // Value used to resume fiber: test // [/result] // [/example] // // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/language.fibers.php // LANGUAGE_REFERENCE_FIBERS - END // ============================== // ============================== BEGIN // PHP_BASIC_SPL_CLASS_IMPLEMENTS // ============================== PUBLIC // ============================== ABOUT // Return the interfaces which are implemented by the given class or interface. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // class_implements() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_class_implements($object_or_class, $autoload = true) { $return_class_implements = false; // ========== CLASS_IMPLEMENTS - BEGIN // ===== ABOUT // Return the interfaces which are implemented by the given class or interface // ===== DESCRIPTION // This function returns an array with the names of the interfaces that the given object_or_class and its parents implement. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // class_implements(object|string $object_or_class, bool $autoload = true): array|false // ===== CODE $return_class_implements = class_implements( $object_or_class, // object|string object_or_class - An object (class instance) or a string (class or interface name). $autoload // bool autoload - Whether to autoload if not already loaded. ); // Return Values // An array on success, or false when the given class doesn't exist. // // [examples] // Examples // [example] // Example #1 class_implements() example // [php] // // interface foo { } // class bar implements foo {} // // print_r(class_implements(new bar)); // // // you may also specify the parameter as a string // print_r(class_implements('bar')); // // spl_autoload_register(); // // // use autoloading to load the 'not_loaded' class // print_r(class_implements('not_loaded', true)); // // [/php] // The above example will output something similar to: // [result] // Array // ( // [foo] => foo // ) // Array // ( // [foo] => foo // ) // Array // ( // [interface_of_not_loaded] => interface_of_not_loaded // ) // [/result] // [/example] // [/examples] // // Notes // Note: To check that an object implements an interface, instanceof or the is_a() function should be used instead. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.class-implements.php // ========== CLASS_IMPLEMENTS - END // SYNTAX: // array|false class_implements(object|string $object_or_class, bool $autoload = true) return $return_class_implements; // array|false } // ============================== END // PHP_BASIC_SPL_CLASS_IMPLEMENTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_CLASS_PARENTS // ============================== PUBLIC // ============================== ABOUT // Return the parent classes of the given class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // class_parents() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_class_parents($object_or_class, $autoload = true) { $return_class_parents = false; // ========== CLASS_PARENTS - BEGIN // ===== ABOUT // Return the parent classes of the given class // ===== DESCRIPTION // This function returns an array with the name of the parent classes of the given object_or_class. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // class_parents(object|string $object_or_class, bool $autoload = true): array|false // ===== CODE $return_class_parents = class_parents( $object_or_class, // object|string object_or_class - An object (class instance) or a string (class name). $autoload // bool autoload - Whether to autoload if not already loaded. ); // Return Values // An array on success, or false when the given class doesn't exist. // // [examples] // Examples // [example] // Example #1 class_parents() example // [php] // // class foo { } // class bar extends foo {} // // print_r(class_parents(new bar)); // // // you may also specify the parameter as a string // print_r(class_parents('bar')); // // spl_autoload_register(); // // // use autoloading to load the 'not_loaded' class // print_r(class_parents('not_loaded', true)); // // [/php] // The above example will output something similar to: // [result] // Array // ( // [foo] => foo // ) // Array // ( // [foo] => foo // ) // Array // ( // [parent_of_not_loaded] => parent_of_not_loaded // ) // [/result] // [/example] // [/examples] // // Notes // Note: To check that an object extends a class, instanceof or the is_a() function should be used instead. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.class-parents.php // ========== CLASS_PARENTS - END // SYNTAX: // array|false class_parents(object|string $object_or_class, bool $autoload = true) return $return_class_parents; // array|false } // ============================== END // PHP_BASIC_SPL_CLASS_PARENTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_CLASS_USES // ============================== PUBLIC // ============================== ABOUT // Return the traits used by the given class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // class_uses() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_class_uses($object_or_class, $autoload = true) { $return_class_uses = false; // ========== CLASS_USES - BEGIN // ===== ABOUT // Return the traits used by the given class // ===== DESCRIPTION // This function returns an array with the names of the traits that the given object_or_class uses. This does however not include any traits used by a parent class. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // class_uses(object|string $object_or_class, bool $autoload = true): array|false // ===== CODE $return_class_uses = class_uses( $object_or_class, // object|string object_or_class - An object (class instance) or a string (class name). $autoload // bool autoload - Whether to autoload if not already loaded. ); // Return Values // An array on success, or false when the given class doesn't exist. // // [examples] // Examples // [example] // Example #1 class_uses() example // [php] // // trait foo { } // class bar { // use foo; // } // // print_r(class_uses(new bar)); // // print_r(class_uses('bar')); // // spl_autoload_register(); // // // use autoloading to load the 'not_loaded' class // print_r(class_uses('not_loaded', true)); // // [/php] // The above example will output something similar to: // [result] // Array // ( // [foo] => foo // ) // Array // ( // [foo] => foo // ) // Array // ( // [trait_of_not_loaded] => trait_of_not_loaded // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.class-uses.php // ========== CLASS_USES - END // SYNTAX: // array|false class_uses(object|string $object_or_class, bool $autoload = true) return $return_class_uses; // array|false } // ============================== END // PHP_BASIC_SPL_CLASS_USES // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATOR_APPLY // ============================== PUBLIC // ============================== ABOUT // Call a function for every element in an iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // iterator_apply() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterator_apply($iterator, $callback, $args = null) { $return_iterator_apply = 0; // ========== ITERATOR_APPLY - BEGIN // ===== ABOUT // Call a function for every element in an iterator // ===== DESCRIPTION // Calls a function for every element in an iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // iterator_apply(Traversable $iterator, callable $callback, ?array $args = null): int // ===== CODE $return_iterator_apply = iterator_apply( $iterator, // Traversable iterator - The iterator object to iterate over. $callback, // callable callback - The callback function to call on every element. This function only receives the given args, so it is nullary by default. If count($args) === 3, for instance, the callback function is ternary. // Note: The function must return true in order to continue iterating over the iterator. $args // array args - An array of arguments; each element of args is passed to the callback callback as separate argument. ); // Return Values // Returns the iteration count. // // [examples] // Examples // [example] // Example #1 iterator_apply() example // [php] // function print_caps(Iterator $iterator) { // echo strtoupper($iterator->current()) . "\n"; // return TRUE; // } // // $it = new ArrayIterator(array("Apples", "Bananas", "Cherries")); // iterator_apply($it, "print_caps", array($it)); // [/php] // The above example will output: // [result] // APPLES // BANANAS // CHERRIES // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.iterator-apply.php // ========== ITERATOR_APPLY - END // SYNTAX: // int iterator_apply(Traversable $iterator, callable $callback, array $args = null) return $return_iterator_apply; // int } // ============================== END // PHP_BASIC_SPL_ITERATOR_APPLY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATOR_COUNT // ============================== PUBLIC // ============================== ABOUT // Count the elements in an iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // iterator_count() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterator_count($iterator) { $return_iterator_count = 0; // ========== ITERATOR_COUNT - BEGIN // ===== ABOUT // Count the elements in an iterator // ===== DESCRIPTION // Count the elements in an iterator. iterator_count() is not guaranteed to retain the current position of the iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // iterator_count(Traversable|array $iterator): int // ===== CODE $return_iterator_count = iterator_count( $iterator // Traversable|array iterator - The iterator being counted. ); // Return Values // The number of elements in iterator. // // Changelog // Version - Description // 8.2.0 - The type of iterator has been widened from Traversable to Traversable|array. // // [examples] // Examples // [example] // Example #1 iterator_count() example // [php] // $iterator = new ArrayIterator(array('recipe'=>'pancakes', 'egg', 'milk', 'flour')); // var_dump(iterator_count($iterator)); // [/php] // The above example will output: // [result] // int(4) // [/result] // [/example] // [example] // Example #2 iterator_count() modifies position // [php] // $iterator = new ArrayIterator(['one', 'two', 'three']); // var_dump($iterator->current()); // var_dump(iterator_count($iterator)); // var_dump($iterator->current()); // [/php] // The above example will output: // [result] // string(3) "one" // int(3) // NULL // [/result] // [/example] // [example] // Example #3 iterator_count() in foreach loops // [php] // $iterator = new ArrayIterator(['one', 'two', 'three']); // foreach ($iterator as $key => $value) { // echo "$key: $value (", iterator_count($iterator), ")\n"; // } // [/php] // The above example will output: // [result] // 0: one (3) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.iterator-count.php // ========== ITERATOR_COUNT - END // SYNTAX: // int iterator_count(Traversable|array $iterator) return $return_iterator_count; // int } // ============================== END // PHP_BASIC_SPL_ITERATOR_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATOR_TO_ARRAY // ============================== PUBLIC // ============================== ABOUT // Copy the iterator into an array. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // iterator_to_array() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterator_to_array($iterator, $preserve_keys = true) { $return_iterator_to_array = null; // ========== ITERATOR_TO_ARRAY - BEGIN // ===== ABOUT // Copy the iterator into an array // ===== DESCRIPTION // Copy the elements of an iterator into an array. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // iterator_to_array(Traversable|array $iterator, bool $preserve_keys = true): array // ===== CODE $return_iterator_to_array = iterator_to_array( $iterator, // Traversable|array iterator - The iterator being copied. $preserve_keys // bool preserve_keys - Whether to use the iterator element keys as index. // If a key is an array or object, a warning will be generated. null keys will be converted to an empty string, float keys will be truncated to their int counterpart, resource keys will generate a warning and be converted to their resource ID, and bool keys will be converted to integers. // Note: If this parameter is not set or set to true, duplicate keys will be overwritten. The last value with a given key will be in the returned array. Set this parameter to false to get all the values in any case. ); // Return Values // An array containing the elements of the iterator. // // Changelog // Version - Description // 8.2.0 - The type of iterator has been widened from Traversable to Traversable|array. // // [examples] // Examples // [example] // Example #1 iterator_to_array() example // [php] // $iterator = new ArrayIterator(array('recipe'=>'pancakes', 'egg', 'milk', 'flour')); // var_dump(iterator_to_array($iterator, true)); // var_dump(iterator_to_array($iterator, false)); // [/php] // The above example will output: // [result] // array(4) { // ["recipe"]=> // string(8) "pancakes" // [0]=> // string(3) "egg" // [1]=> // string(4) "milk" // [2]=> // string(5) "flour" // } // array(4) { // [0]=> // string(8) "pancakes" // [1]=> // string(3) "egg" // [2]=> // string(4) "milk" // [3]=> // string(5) "flour" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.iterator-to-array.php // ========== ITERATOR_TO_ARRAY - END // SYNTAX: // array iterator_to_array(Traversable|array $iterator, bool $preserve_keys = true) return $return_iterator_to_array; // array } // ============================== END // PHP_BASIC_SPL_ITERATOR_TO_ARRAY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_AUTOLOAD_CALL // ============================== PUBLIC // ============================== ABOUT // Try all registered __autoload() functions to load the requested class. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_autoload_call() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_autoload_call($class) { // ========== SPL_AUTOLOAD_CALL - BEGIN // ===== ABOUT // Try all registered __autoload() functions to load the requested class // ===== DESCRIPTION // This function can be used to manually search for a class or interface using the registered __autoload functions. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // spl_autoload_call(string $class): void // ===== CODE spl_autoload_call( $class // string class - The class name being searched. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-10-01) // URL: https://www.php.net/manual/en/function.spl-autoload-call.php // ========== SPL_AUTOLOAD_CALL - END // SYNTAX: // void spl_autoload_call(string $class) // Return: void } // ============================== END // PHP_BASIC_SPL_SPL_AUTOLOAD_CALL // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_AUTOLOAD_EXTENSIONS // ============================== PUBLIC // ============================== ABOUT // Register and return default file extensions for spl_autoload. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_autoload_extensions() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_autoload_extensions($file_extensions = null) { $return_spl_autoload_extensions = null; // ========== SPL_AUTOLOAD_EXTENSIONS - BEGIN // ===== ABOUT // Register and return default file extensions for spl_autoload // ===== DESCRIPTION // This function can modify and check the file extensions that the built in __autoload() fallback function spl_autoload() will be using. // Note: There should not be a space between the defined file extensions. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // spl_autoload_extensions(?string $file_extensions = null): string // ===== CODE $return_spl_autoload_extensions = spl_autoload_extensions( $file_extensions // string file_extensions - If null, it simply returns the current list of extensions each separated by comma. To modify the list of file extensions, simply invoke the functions with the new list of file extensions to use in a single string with each extensions separated by comma. ); // Return Values // A comma delimited list of default file extensions for spl_autoload(). // // Changelog // Version - Description // 8.0.0 - file_extensions is now nullable. // // [examples] // Examples // [example] // Example #1 spl_autoload_extensions() example // [php] // spl_autoload_extensions(".php,.inc"); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.spl-autoload-extensions.php // ========== SPL_AUTOLOAD_EXTENSIONS - END // SYNTAX: // string spl_autoload_extensions(string $file_extensions = null) return $return_spl_autoload_extensions; // string } // ============================== END // PHP_BASIC_SPL_SPL_AUTOLOAD_EXTENSIONS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_AUTOLOAD_FUNCTIONS // ============================== PUBLIC // ============================== ABOUT // Return all registered __autoload() functions. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_autoload_functions() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_autoload_functions() { $return_spl_autoload_functions = null; // ========== SPL_AUTOLOAD_FUNCTIONS - BEGIN // ===== ABOUT // Return all registered __autoload() functions // ===== DESCRIPTION // Get all registered __autoload() functions. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // spl_autoload_functions(): array // ===== CODE $return_spl_autoload_functions = spl_autoload_functions( // This function has no parameters. ); // Return Values // An array of all registered __autoload functions. If no function is registered, or the autoload queue is not activated, then the return value will be an empty array. // // Changelog // Version - Description // 8.0.0 - Return value was updated to always be an array; previously this function returned false if the autoload queue wasn't activated. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.spl-autoload-functions.php // ========== SPL_AUTOLOAD_FUNCTIONS - END // SYNTAX: // array spl_autoload_functions() return $return_spl_autoload_functions; // array } // ============================== END // PHP_BASIC_SPL_SPL_AUTOLOAD_FUNCTIONS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_AUTOLOAD_REGISTER // ============================== PUBLIC // ============================== ABOUT // Register given function as __autoload() implementation. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_autoload_register() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_autoload_register($callback = null, $throw = true, $prepend = false) { $return_spl_autoload_register = false; // ========== SPL_AUTOLOAD_REGISTER - BEGIN // ===== ABOUT // Register given function as __autoload() implementation // ===== DESCRIPTION // Register a function with the spl provided __autoload queue. If the queue is not yet activated it will be activated. // If your code has an existing __autoload() function then this function must be explicitly registered on the __autoload queue. This is because spl_autoload_register() will effectively replace the engine cache for the __autoload() function by either spl_autoload() or spl_autoload_call(). // If there must be multiple autoload functions, spl_autoload_register() allows for this. It effectively creates a queue of autoload functions, and runs through each of them in the order they are defined. By contrast, __autoload() may only be defined once. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // spl_autoload_register(?callable $callback = null, bool $throw = true, bool $prepend = false): bool // ===== CODE $return_spl_autoload_register = spl_autoload_register( $callback, // callable callback - The autoload function being registered. If null, then the default implementation of spl_autoload() will be registered. // callback(string $class): void // The class will not contain the leading backslash of a fully-qualified identifier. $throw, // bool throw - This parameter specifies whether spl_autoload_register() should throw exceptions when the callback cannot be registered. // Warning: This parameter is ignored as of PHP 8.0.0, and a notice will be emitted if set to false. spl_autoload_register() will now always throw a TypeError on invalid arguments. $prepend // bool prepend - If true, spl_autoload_register() will prepend the autoloader on the autoload queue instead of appending it. ); // Return Values // Returns true on success or false on failure. // // Changelog // Version - Description // 8.0.0 - callback is now nullable. // // [examples] // Examples // [example] // Example #1 spl_autoload_register() as a replacement for an __autoload() function // [php] // // // function __autoload($class) { // // include 'classes/' . $class . '.class.php'; // // } // // function my_autoloader($class) { // include 'classes/' . $class . '.class.php'; // } // // spl_autoload_register('my_autoloader'); // // // Or, using an anonymous function // spl_autoload_register(function ($class) { // include 'classes/' . $class . '.class.php'; // }); // // [/php] // [/example] // [example] // Example #2 spl_autoload_register() example where the class is not loaded // [php] // // namespace Foobar; // // class Foo { // static public function test($class) { // print '[['. $class .']]'; // } // } // // spl_autoload_register(__NAMESPACE__ .'\Foo::test'); // // new InexistentClass; // // [/php] // The above example will output something similar to: // [result] // [[Foobar\InexistentClass]] // Fatal error: Class 'Foobar\InexistentClass' not found in ... // [/result] // [/example] // [example] // Example #3 The identifier will be provided without the leading backslash // [php] // // spl_autoload_register(static function ($class) { // var_dump($class); // }); // // class_exists('RelativeName'); // class_exists('RelativeName\\WithNamespace'); // class_exists('\\AbsoluteName'); // class_exists('\\AbsoluteName\\WithNamespace'); // // [/php] // The above example will output: // [result] // string(12) "RelativeName" // string(26) "RelativeName\WithNamespace" // string(12) "AbsoluteName" // string(26) "AbsoluteName\WithNamespace" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.spl-autoload-register.php // ========== SPL_AUTOLOAD_REGISTER - END // SYNTAX: // bool spl_autoload_register(callable $callback = null, bool $throw = true, bool $prepend = false) return $return_spl_autoload_register; // bool } // ============================== END // PHP_BASIC_SPL_SPL_AUTOLOAD_REGISTER // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_AUTOLOAD_UNREGISTER // ============================== PUBLIC // ============================== ABOUT // Unregister given function as __autoload() implementation. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_autoload_unregister() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_autoload_unregister($callback) { $return_spl_autoload_unregister = false; // ========== SPL_AUTOLOAD_UNREGISTER - BEGIN // ===== ABOUT // Unregister given function as __autoload() implementation // ===== DESCRIPTION // Removes a function from the autoload queue. If the queue is activated and empty after removing the given function then it will be deactivated. // When this function results in the queue being deactivated, any __autoload function that previously existed will not be reactivated. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // spl_autoload_unregister(callable $callback): bool // ===== CODE $return_spl_autoload_unregister = spl_autoload_unregister( $callback // callable callback - The autoload function being unregistered. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-02) // URL: https://www.php.net/manual/en/function.spl-autoload-unregister.php // ========== SPL_AUTOLOAD_UNREGISTER - END // SYNTAX: // bool spl_autoload_unregister(callable $callback) return $return_spl_autoload_unregister; // bool } // ============================== END // PHP_BASIC_SPL_SPL_AUTOLOAD_UNREGISTER // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_AUTOLOAD // ============================== PUBLIC // ============================== ABOUT // Default implementation for __autoload(). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_autoload() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_autoload($class, $file_extensions = null) { // ========== SPL_AUTOLOAD - BEGIN // ===== ABOUT // Default implementation for __autoload() // ===== DESCRIPTION // This function is intended to be used as a default implementation for __autoload(). If nothing else is specified and spl_autoload_register() is called without any parameters then this function will be used for any later call to __autoload(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // spl_autoload(string $class, ?string $file_extensions = null): void // ===== CODE spl_autoload( $class, // string class - The name of the class (and namespace) being instantiated. $file_extensions // string file_extensions - By default it checks all include paths to contain filenames built up by the lowercase class name appended by the filename extensions .inc and .php. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws LogicException when the class is not found and there are no other autoloaders registered. // // Changelog // Version - Description // 8.0.0 - file_extensions is now nullable. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-02) // URL: https://www.php.net/manual/en/function.spl-autoload.php // ========== SPL_AUTOLOAD - END // SYNTAX: // void spl_autoload(string $class, string $file_extensions = null) // Return: void } // ============================== END // PHP_BASIC_SPL_SPL_AUTOLOAD // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_CLASSES // ============================== PUBLIC // ============================== ABOUT // Return available SPL classes. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_classes() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_classes() { $return_spl_classes = null; // ========== SPL_CLASSES - BEGIN // ===== ABOUT // Return available SPL classes // ===== DESCRIPTION // This function returns an array with the current available SPL classes. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // spl_classes(): array // ===== CODE $return_spl_classes = spl_classes( // This function has no parameters. ); // Return Values // Returns an array containing the currently available SPL classes. // // [examples] // Examples // [example] // Example #1 spl_classes() example // [php] // // print_r(spl_classes()); // // [/php] // The above example will output something similar to: // [result] // Array // ( // [ArrayObject] => ArrayObject // [ArrayIterator] => ArrayIterator // [CachingIterator] => CachingIterator // [RecursiveCachingIterator] => RecursiveCachingIterator // [DirectoryIterator] => DirectoryIterator // [FilterIterator] => FilterIterator // [LimitIterator] => LimitIterator // [ParentIterator] => ParentIterator // [RecursiveDirectoryIterator] => RecursiveDirectoryIterator // [RecursiveIterator] => RecursiveIterator // [RecursiveIteratorIterator] => RecursiveIteratorIterator // [SeekableIterator] => SeekableIterator // [SimpleXMLIterator] => SimpleXMLIterator // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.spl-classes.php // ========== SPL_CLASSES - END // SYNTAX: // array spl_classes() return $return_spl_classes; // array } // ============================== END // PHP_BASIC_SPL_SPL_CLASSES // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_OBJECT_HASH // ============================== PUBLIC // ============================== ABOUT // Return hash id for given object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_object_hash() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_spl_object_hash($object) { $return_spl_object_hash = null; // ========== SPL_OBJECT_HASH - BEGIN // ===== ABOUT // Return hash id for given object // ===== DESCRIPTION // This function returns a unique identifier for the object. This id can be used as a hash key for storing objects, or for identifying an object, as long as the object is not destroyed. Once the object is destroyed, its hash may be reused for other objects. This behavior is similar to spl_object_id(). // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // spl_object_hash(object $object): string // ===== CODE $return_spl_object_hash = spl_object_hash( $object // object object - Any object. ); // Return Values // A string that is unique for each currently existing object and is always the same for each object. // // [examples] // Examples // [example] // Example #1 A spl_object_hash() example // [php] // $id = spl_object_hash($object); // $storage[$id] = $object; // [/php] // [/example] // [/examples] // // Notes // Note: When an object is destroyed, its hash may be reused for other objects. // Note: Object hashes should be compared for identity with === and !==, because the returned hash could be a numeric string. For example: 0000000000000e600000000000000000. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.spl-object-hash.php // ========== SPL_OBJECT_HASH - END // SYNTAX: // string spl_object_hash(object $object) return $return_spl_object_hash; // string } // ============================== END // PHP_BASIC_SPL_SPL_OBJECT_HASH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_SPL_OBJECT_ID // ============================== OFFLINE // ============================== ABOUT // Return the integer object handle for given object. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING FUNCTIONS (1) // spl_object_id() - PHP_7 >= PHP_7_2_0, PHP_8 // ============================== CODE /* function php_basic_spl_spl_object_id($object) { $return_spl_object_id = 0; // ========== SPL_OBJECT_ID - BEGIN // ===== ABOUT // Return the integer object handle for given object // ===== DESCRIPTION // This function returns a unique identifier for the object. The object id is unique for the lifetime of the object. Once the object is destroyed, its id may be reused for other objects. This behavior is similar to spl_object_hash(). // ===== SUPPORTED // PHP_7 >= PHP_7_2_0, PHP_8 // ===== SYNTAX // spl_object_id(object $object): int // ===== CODE $return_spl_object_id = spl_object_id( $object // object object - Any object. ); // Return Values // An integer identifier that is unique for each currently existing object and is always the same for each object. // // [examples] // Examples // [example] // Example #1 A spl_object_id() example // [php] // $id = spl_object_id($object); // $storage[$id] = $object; // [/php] // [/example] // [/examples] // // Notes // Note: When an object is destroyed, its id may be reused for other objects. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/function.spl-object-id.php // ========== SPL_OBJECT_ID - END // SYNTAX: // int spl_object_id(object $object) return $return_spl_object_id; // int } */ // ============================== END // PHP_BASIC_SPL_SPL_OBJECT_ID // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES // ============================== PUBLIC // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_ADD - void php_basic_spl_datastructures_spldoublylinkedlist_add(SplDoublyLinkedList $spldoublylinkedlist, int $index, mixed $value) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_BOTTOM - mixed php_basic_spl_datastructures_spldoublylinkedlist_bottom(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_COUNT - int php_basic_spl_datastructures_spldoublylinkedlist_count(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_CURRENT - mixed php_basic_spl_datastructures_spldoublylinkedlist_current(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_GETITERATORMODE - int php_basic_spl_datastructures_spldoublylinkedlist_getiteratormode(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_ISEMPTY - bool php_basic_spl_datastructures_spldoublylinkedlist_isempty(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_KEY - int php_basic_spl_datastructures_spldoublylinkedlist_key(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_NEXT - void php_basic_spl_datastructures_spldoublylinkedlist_next(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETEXISTS - bool php_basic_spl_datastructures_spldoublylinkedlist_offsetexists(SplDoublyLinkedList $spldoublylinkedlist, int $index) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETGET - mixed php_basic_spl_datastructures_spldoublylinkedlist_offsetget(SplDoublyLinkedList $spldoublylinkedlist, int $index) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETSET - void php_basic_spl_datastructures_spldoublylinkedlist_offsetset(SplDoublyLinkedList $spldoublylinkedlist, int $index, mixed $value) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETUNSET - void php_basic_spl_datastructures_spldoublylinkedlist_offsetunset(SplDoublyLinkedList $spldoublylinkedlist, int $index) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_POP - mixed php_basic_spl_datastructures_spldoublylinkedlist_pop(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_PREV - void php_basic_spl_datastructures_spldoublylinkedlist_prev(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_PUSH - void php_basic_spl_datastructures_spldoublylinkedlist_push(SplDoublyLinkedList $spldoublylinkedlist, mixed $value) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_REWIND - void php_basic_spl_datastructures_spldoublylinkedlist_rewind(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SERIALIZE - string php_basic_spl_datastructures_spldoublylinkedlist_serialize(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SETITERATORMODE - int php_basic_spl_datastructures_spldoublylinkedlist_setiteratormode(SplDoublyLinkedList $spldoublylinkedlist, int $mode) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SHIFT - mixed php_basic_spl_datastructures_spldoublylinkedlist_shift(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_TOP - mixed php_basic_spl_datastructures_spldoublylinkedlist_top(SplDoublyLinkedList $spldoublylinkedlist) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_UNSERIALIZE - void php_basic_spl_datastructures_spldoublylinkedlist_unserialize(SplDoublyLinkedList $spldoublylinkedlist, string $data) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_UNSHIFT - void php_basic_spl_datastructures_spldoublylinkedlist_unshift(SplDoublyLinkedList $spldoublylinkedlist, mixed $value) // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_VALID - bool php_basic_spl_datastructures_spldoublylinkedlist_valid(SplDoublyLinkedList $spldoublylinkedlist) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (23) // SplDoublyLinkedList::add() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // SplDoublyLinkedList::bottom() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::getIteratorMode() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::isEmpty() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::offsetExists() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::offsetGet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::offsetSet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::offsetUnset() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::pop() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::prev() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::push() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::serialize() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // SplDoublyLinkedList::setIteratorMode() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::shift() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::top() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::unserialize() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // SplDoublyLinkedList::unshift() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplDoublyLinkedList::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (6) // void // SplDoublyLinkedList - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // int // mixed // bool // string // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_ADD // ============================== PUBLIC // ============================== ABOUT // Add/insert a new value at the specified index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::add() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_add($spldoublylinkedlist, $index, $value) { // ========== SPLDOUBLYLINKEDLIST_ADD - BEGIN // ===== ABOUT // Add/insert a new value at the specified index // ===== DESCRIPTION // Insert the value value at the specified index, shuffling the previous value at that index (and all subsequent values) up through the list. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::add(int $index, mixed $value): void // ===== CODE $spldoublylinkedlist->add( $index, // int index - The index where the new value is to be inserted. $value // mixed value - The new value for the index. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws OutOfRangeException when index is out of bounds or when index cannot be parsed as an integer. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.add.php // ========== SPLDOUBLYLINKEDLIST_ADD - END // SYNTAX: // void SplDoublyLinkedList::add(int $index, mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_ADD // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_BOTTOM // ============================== PUBLIC // ============================== ABOUT // Peeks at the node from the beginning of the doubly linked list. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::bottom() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_bottom($spldoublylinkedlist) { $return_spldoublylinkedlist_bottom = null; // ========== SPLDOUBLYLINKEDLIST_BOTTOM - BEGIN // ===== ABOUT // Peeks at the node from the beginning of the doubly linked list // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::bottom(): mixed // ===== CODE $return_spldoublylinkedlist_bottom = $spldoublylinkedlist->bottom( // This function has no parameters. ); // Return Values // The value of the first node. // // Errors/Exceptions // Throws RuntimeException when the data-structure is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.bottom.php // ========== SPLDOUBLYLINKEDLIST_BOTTOM - END // SYNTAX: // mixed SplDoublyLinkedList::bottom() return $return_spldoublylinkedlist_bottom; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_BOTTOM // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_COUNT // ============================== PUBLIC // ============================== ABOUT // Counts the number of elements in the doubly linked list. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_count($spldoublylinkedlist) { $return_spldoublylinkedlist_count = 0; // ========== SPLDOUBLYLINKEDLIST_COUNT - BEGIN // ===== ABOUT // Counts the number of elements in the doubly linked list // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::count(): int // ===== CODE $return_spldoublylinkedlist_count = $spldoublylinkedlist->count( // This function has no parameters. ); // Return Values // Returns the number of elements in the doubly linked list. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.count.php // ========== SPLDOUBLYLINKEDLIST_COUNT - END // SYNTAX: // int SplDoublyLinkedList::count() return $return_spldoublylinkedlist_count; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_CURRENT // ============================== PUBLIC // ============================== ABOUT // Return current array entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_current($spldoublylinkedlist) { $return_spldoublylinkedlist_current = null; // ========== SPLDOUBLYLINKEDLIST_CURRENT - BEGIN // ===== ABOUT // Return current array entry // ===== DESCRIPTION // Get the current doubly linked list node. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::current(): mixed // ===== CODE $return_spldoublylinkedlist_current = $spldoublylinkedlist->current( // This function has no parameters. ); // Return Values // The current node value. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://php.net/manual/en/spldoublylinkedlist.current.php // ========== SPLDOUBLYLINKEDLIST_CURRENT - END // SYNTAX: // mixed SplDoublyLinkedList::current() return $return_spldoublylinkedlist_current; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_GETITERATORMODE // ============================== PUBLIC // ============================== ABOUT // Returns the mode of iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::getIteratorMode() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_getiteratormode($spldoublylinkedlist) { $return_spldoublylinkedlist_getiteratormode = 0; // ========== SPLDOUBLYLINKEDLIST_GETITERATORMODE - BEGIN // ===== ABOUT // Returns the mode of iteration // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::getIteratorMode(): int // ===== CODE $return_spldoublylinkedlist_getiteratormode = $spldoublylinkedlist->getIteratorMode( // This function has no parameters. ); // Return Values // Returns the different modes and flags that affect the iteration. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.getiteratormode.php // ========== SPLDOUBLYLINKEDLIST_GETITERATORMODE - END // SYNTAX: // int SplDoublyLinkedList::getIteratorMode() return $return_spldoublylinkedlist_getiteratormode; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_GETITERATORMODE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_ISEMPTY // ============================== PUBLIC // ============================== ABOUT // Checks whether the doubly linked list is empty. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::isEmpty() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_isempty($spldoublylinkedlist) { $return_spldoublylinkedlist_isempty = false; // ========== SPLDOUBLYLINKEDLIST_ISEMPTY - BEGIN // ===== ABOUT // Checks whether the doubly linked list is empty // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::isEmpty(): bool // ===== CODE $return_spldoublylinkedlist_isempty = $spldoublylinkedlist->isEmpty( // This function has no parameters. ); // Return Values // Returns whether the doubly linked list is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.isempty.php // ========== SPLDOUBLYLINKEDLIST_ISEMPTY - END // SYNTAX: // bool SplDoublyLinkedList::isEmpty() return $return_spldoublylinkedlist_isempty; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_ISEMPTY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_KEY // ============================== PUBLIC // ============================== ABOUT // Return current node index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_key($spldoublylinkedlist) { $return_spldoublylinkedlist_key = 0; // ========== SPLDOUBLYLINKEDLIST_KEY - BEGIN // ===== ABOUT // Return current node index // ===== DESCRIPTION // This function returns the current node index // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::key(): int // ===== CODE $return_spldoublylinkedlist_key = $spldoublylinkedlist->key( // This function has no parameters. ); // Return Values // The current node index. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.key.php // ========== SPLDOUBLYLINKEDLIST_KEY - END // SYNTAX: // int SplDoublyLinkedList::key() return $return_spldoublylinkedlist_key; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to next entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_next($spldoublylinkedlist) { // ========== SPLDOUBLYLINKEDLIST_NEXT - BEGIN // ===== ABOUT // Move to next entry // ===== DESCRIPTION // Move the iterator to the next node. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::next(): void // ===== CODE $spldoublylinkedlist->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.next.php // ========== SPLDOUBLYLINKEDLIST_NEXT - END // SYNTAX: // void SplDoublyLinkedList::next() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETEXISTS // ============================== PUBLIC // ============================== ABOUT // Returns whether the requested $index exists. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::offsetExists() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_offsetexists($spldoublylinkedlist, $index) { $return_spldoublylinkedlist_offsetexists = false; // ========== SPLDOUBLYLINKEDLIST_OFFSETEXISTS - BEGIN // ===== ABOUT // Returns whether the requested $index exists // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::offsetExists(int $index): bool // ===== CODE $return_spldoublylinkedlist_offsetexists = $spldoublylinkedlist->offsetExists( $index // int index - The index being checked. ); // Return Values // true if the requested index exists, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.offsetexists.php // ========== SPLDOUBLYLINKEDLIST_OFFSETEXISTS - END // SYNTAX: // bool SplDoublyLinkedList::offsetExists(int $index) return $return_spldoublylinkedlist_offsetexists; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETEXISTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETGET // ============================== PUBLIC // ============================== ABOUT // Returns the value at the specified $index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::offsetGet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_offsetget($spldoublylinkedlist, $index) { $return_spldoublylinkedlist_offsetget = null; // ========== SPLDOUBLYLINKEDLIST_OFFSETGET - BEGIN // ===== ABOUT // Returns the value at the specified $index // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::offsetGet(int $index): mixed // ===== CODE $return_spldoublylinkedlist_offsetget = $spldoublylinkedlist->offsetGet( $index // int index - The index with the value. ); // Return Values // The value at the specified index. // // Errors/Exceptions // Throws OutOfRangeException when index is out of bounds or when index cannot be parsed as an integer. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.offsetget.php // ========== SPLDOUBLYLINKEDLIST_OFFSETGET - END // SYNTAX: // mixed SplDoublyLinkedList::offsetGet(int $index) return $return_spldoublylinkedlist_offsetget; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETGET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETSET // ============================== PUBLIC // ============================== ABOUT // Sets the value at the specified $index to $value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::offsetSet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_offsetset($spldoublylinkedlist, $index, $value) { // ========== SPLDOUBLYLINKEDLIST_OFFSETSET - BEGIN // ===== ABOUT // Sets the value at the specified $index to $value // ===== DESCRIPTION // Sets the value at the specified index to value. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::offsetSet(?int $index, mixed $value): void // ===== CODE $spldoublylinkedlist->offsetSet( $index, // int index - The index being set. If null, the next value will be added after the last item. $value // mixed value - The new value for the index. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws OutOfRangeException when index is out of bounds or when index cannot be parsed as an integer. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.offsetset.php // ========== SPLDOUBLYLINKEDLIST_OFFSETSET - END // SYNTAX: // void SplDoublyLinkedList::offsetSet(int $index, mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETUNSET // ============================== PUBLIC // ============================== ABOUT // Unsets the value at the specified $index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::offsetUnset() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_offsetunset($spldoublylinkedlist, $index) { // ========== SPLDOUBLYLINKEDLIST_OFFSETUNSET - BEGIN // ===== ABOUT // Unsets the value at the specified $index // ===== DESCRIPTION // Unsets the value at the specified index. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::offsetUnset(int $index): void // ===== CODE $spldoublylinkedlist->offsetUnset( $index // int index - The index being unset. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws OutOfRangeException when index is out of bounds or when index cannot be parsed as an integer. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.offsetunset.php // ========== SPLDOUBLYLINKEDLIST_OFFSETUNSET - END // SYNTAX: // void SplDoublyLinkedList::offsetUnset(int $index) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_OFFSETUNSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_POP // ============================== PUBLIC // ============================== ABOUT // Pops a node from the end of the doubly linked list. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::pop() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_pop($spldoublylinkedlist) { $return_spldoublylinkedlist_pop = null; // ========== SPLDOUBLYLINKEDLIST_POP - BEGIN // ===== ABOUT // Pops a node from the end of the doubly linked list // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::pop(): mixed // ===== CODE $return_spldoublylinkedlist_pop = $spldoublylinkedlist->pop( // This function has no parameters. ); // Return Values // The value of the popped node. // // Errors/Exceptions // Throws RuntimeException when the data-structure is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.pop.php // ========== SPLDOUBLYLINKEDLIST_POP - END // SYNTAX: // mixed SplDoublyLinkedList::pop() return $return_spldoublylinkedlist_pop; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_POP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_PREV // ============================== PUBLIC // ============================== ABOUT // Move to previous entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::prev() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_prev($spldoublylinkedlist) { // ========== SPLDOUBLYLINKEDLIST_PREV - BEGIN // ===== ABOUT // Move to previous entry // ===== DESCRIPTION // Move the iterator to the previous node. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::prev(): void // ===== CODE $spldoublylinkedlist->prev( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.prev.php // ========== SPLDOUBLYLINKEDLIST_PREV - END // SYNTAX: // void SplDoublyLinkedList::prev() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_PREV // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_PUSH // ============================== PUBLIC // ============================== ABOUT // Pushes an element at the end of the doubly linked list. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::push() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_push($spldoublylinkedlist, $value) { // ========== SPLDOUBLYLINKEDLIST_PUSH - BEGIN // ===== ABOUT // Pushes an element at the end of the doubly linked list // ===== DESCRIPTION // Pushes value at the end of the doubly linked list. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::push(mixed $value): void // ===== CODE $spldoublylinkedlist->push( $value // mixed value - The value to push. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.push.php // ========== SPLDOUBLYLINKEDLIST_PUSH - END // SYNTAX: // void SplDoublyLinkedList::push(mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_PUSH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind iterator back to the start. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_rewind($spldoublylinkedlist) { // ========== SPLDOUBLYLINKEDLIST_REWIND - BEGIN // ===== ABOUT // Rewind iterator back to the start // ===== DESCRIPTION // This rewinds the iterator to the beginning. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::rewind(): void // ===== CODE $spldoublylinkedlist->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.rewind.php // ========== SPLDOUBLYLINKEDLIST_REWIND - END // SYNTAX: // void SplDoublyLinkedList::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SERIALIZE // ============================== PUBLIC // ============================== ABOUT // Serializes the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::serialize() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_serialize($spldoublylinkedlist) { $return_spldoublylinkedlist_serialize = null; // ========== SPLDOUBLYLINKEDLIST_SERIALIZE - BEGIN // ===== ABOUT // Serializes the storage // ===== DESCRIPTION // Serializes the storage. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::serialize(): string // ===== CODE $return_spldoublylinkedlist_serialize = $spldoublylinkedlist->serialize( // This function has no parameters. ); // Return Values // The serialized string. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.serialize.php // ========== SPLDOUBLYLINKEDLIST_SERIALIZE - END // SYNTAX: // string SplDoublyLinkedList::serialize() return $return_spldoublylinkedlist_serialize; // string } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SETITERATORMODE // ============================== PUBLIC // ============================== ABOUT // Sets the mode of iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::setIteratorMode() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_setiteratormode($spldoublylinkedlist, $mode) { $return_spldoublylinkedlist_setiteratormode = 0; // ========== SPLDOUBLYLINKEDLIST_SETITERATORMODE - BEGIN // ===== ABOUT // Sets the mode of iteration // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::setIteratorMode(int $mode): int // ===== CODE $return_spldoublylinkedlist_setiteratormode = $spldoublylinkedlist->setIteratorMode( $mode // int mode - There are two orthogonal sets of modes that can be set: // * The direction of the iteration (either one or the other): // * SplDoublyLinkedList::IT_MODE_LIFO (Stack style) // * SplDoublyLinkedList::IT_MODE_FIFO (Queue style) // * The behavior of the iterator (either one or the other): // * SplDoublyLinkedList::IT_MODE_DELETE (Elements are deleted by the iterator) // * SplDoublyLinkedList::IT_MODE_KEEP (Elements are traversed by the iterator) // The default mode is: SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP // Warning: The direction of iteration can not be changed for SplStack and SplQueue classes, it is always SplDoublyLinkedList::IT_MODE_FIFO. Trying to modify it will result in a RuntimeException being thrown. ); // Return Values // Returns the different modes and flags that affect the iteration. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.setiteratormode.php // ========== SPLDOUBLYLINKEDLIST_SETITERATORMODE - END // SYNTAX: // int SplDoublyLinkedList::setIteratorMode(int $mode) return $return_spldoublylinkedlist_setiteratormode; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SETITERATORMODE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SHIFT // ============================== PUBLIC // ============================== ABOUT // Shifts a node from the beginning of the doubly linked list. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::shift() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_shift($spldoublylinkedlist) { $return_spldoublylinkedlist_shift = null; // ========== SPLDOUBLYLINKEDLIST_SHIFT - BEGIN // ===== ABOUT // Shifts a node from the beginning of the doubly linked list // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::shift(): mixed // ===== CODE $return_spldoublylinkedlist_shift = $spldoublylinkedlist->shift( // This function has no parameters. ); // Return Values // The value of the shifted node. // // Errors/Exceptions // Throws RuntimeException when the data-structure is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.shift.php // ========== SPLDOUBLYLINKEDLIST_SHIFT - END // SYNTAX: // mixed SplDoublyLinkedList::shift() return $return_spldoublylinkedlist_shift; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_SHIFT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_TOP // ============================== PUBLIC // ============================== ABOUT // Peeks at the node from the end of the doubly linked list. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::top() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_top($spldoublylinkedlist) { $return_spldoublylinkedlist_top = null; // ========== SPLDOUBLYLINKEDLIST_TOP - BEGIN // ===== ABOUT // Peeks at the node from the end of the doubly linked list // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::top(): mixed // ===== CODE $return_spldoublylinkedlist_top = $spldoublylinkedlist->top( // This function has no parameters. ); // Return Values // The value of the last node. // // Errors/Exceptions // Throws RuntimeException when the data-structure is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.top.php // ========== SPLDOUBLYLINKEDLIST_TOP - END // SYNTAX: // mixed SplDoublyLinkedList::top() return $return_spldoublylinkedlist_top; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_TOP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_UNSERIALIZE // ============================== PUBLIC // ============================== ABOUT // Unserializes the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::unserialize() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_unserialize($spldoublylinkedlist, $data) { // ========== SPLDOUBLYLINKEDLIST_UNSERIALIZE - BEGIN // ===== ABOUT // Unserializes the storage // ===== DESCRIPTION // Unserializes the storage, from SplDoublyLinkedList::serialize(). // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::unserialize(string $data): void // ===== CODE $spldoublylinkedlist->unserialize( $data // string data - The serialized string. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.unserialize.php // ========== SPLDOUBLYLINKEDLIST_UNSERIALIZE - END // SYNTAX: // void SplDoublyLinkedList::unserialize(string $data) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_UNSERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_UNSHIFT // ============================== PUBLIC // ============================== ABOUT // Prepends the doubly linked list with an element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::unshift() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_unshift($spldoublylinkedlist, $value) { // ========== SPLDOUBLYLINKEDLIST_UNSHIFT - BEGIN // ===== ABOUT // Prepends the doubly linked list with an element // ===== DESCRIPTION // Prepends value at the beginning of the doubly linked list. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::unshift(mixed $value): void // ===== CODE $spldoublylinkedlist->unshift( $value // mixed $value - The value to unshift. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.unshift.php // ========== SPLDOUBLYLINKEDLIST_UNSHIFT - END // SYNTAX: // void SplDoublyLinkedList::unshift(mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_UNSHIFT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the doubly linked list contains more nodes. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplDoublyLinkedList::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_spldoublylinkedlist_valid($spldoublylinkedlist) { $return_spldoublylinkedlist_valid = false; // ========== SPLDOUBLYLINKEDLIST_VALID - BEGIN // ===== ABOUT // Check whether the doubly linked list contains more nodes // ===== DESCRIPTION // Checks if the doubly linked list contains any more nodes. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplDoublyLinkedList::valid(): bool // ===== CODE $return_spldoublylinkedlist_valid = $spldoublylinkedlist->valid( // This function has no parameters. ); // Return Values // Returns true if the doubly linked list contains any more nodes, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spldoublylinkedlist.valid.php // ========== SPLDOUBLYLINKEDLIST_VALID - END // SYNTAX: // bool SplDoublyLinkedList::valid() return $return_spldoublylinkedlist_valid; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST_VALID // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLDOUBLYLINKEDLIST // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE_DEQUEUE - mixed php_basic_spl_datastructures_splqueue_dequeue(SplQueue $splqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE_ENQUEUE - void php_basic_spl_datastructures_splqueue_enqueue(SplQueue $splqueue, mixed $value) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // SplQueue::dequeue() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplQueue::enqueue() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // mixed // SplQueue - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE_DEQUEUE // ============================== PUBLIC // ============================== ABOUT // Dequeues a node from the queue. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplQueue::dequeue() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splqueue_dequeue($splqueue) { $return_splqueue_dequeue = null; // ========== SPLQUEUE_DEQUEUE - BEGIN // ===== ABOUT // Dequeues a node from the queue // ===== DESCRIPTION // Dequeues value from the top of the queue. // Note: SplQueue::dequeue() is an alias of SplDoublyLinkedList::shift(). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplQueue::dequeue(): mixed // ===== CODE $return_splqueue_dequeue = $splqueue->dequeue( // This function has no parameters. ); // Return Values // The value of the dequeued node. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splqueue.dequeue.php // ========== SPLQUEUE_DEQUEUE - END // SYNTAX: // mixed SplQueue::dequeue() return $return_splqueue_dequeue; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE_DEQUEUE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE_ENQUEUE // ============================== PUBLIC // ============================== ABOUT // Adds an element to the queue. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplQueue::enqueue() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splqueue_enqueue($splqueue, $value) { // ========== SPLQUEUE_ENQUEUE - BEGIN // ===== ABOUT // Adds an element to the queue // ===== DESCRIPTION // Enqueues value at the end of the queue. // Note: SplQueue::enqueue() is an alias of SplDoublyLinkedList::push(). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplQueue::enqueue(mixed $value): void // ===== CODE $splqueue->enqueue( $value // mixed value - The value to enqueue. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splqueue.enqueue.php // ========== SPLQUEUE_ENQUEUE - END // SYNTAX: // void SplQueue::enqueue(mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE_ENQUEUE // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLQUEUE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_COMPARE - int php_basic_spl_datastructures_splheap_compare(SplHeap $splheap, mixed $value1, mixed $value2) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_COUNT - int php_basic_spl_datastructures_splheap_count(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_CURRENT - mixed php_basic_spl_datastructures_splheap_current(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_EXTRACT - mixed php_basic_spl_datastructures_splheap_extract(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_INSERT - bool php_basic_spl_datastructures_splheap_insert(SplHeap $splheap, mixed $value) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_ISCORRUPTED - bool php_basic_spl_datastructures_splheap_iscorrupted(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_ISEMPTY - bool php_basic_spl_datastructures_splheap_isempty(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_KEY - int php_basic_spl_datastructures_splheap_key(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_NEXT - void php_basic_spl_datastructures_splheap_next(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_RECOVERFROMCORRUPTION - bool php_basic_spl_datastructures_splheap_recoverfromcorruption(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_REWIND - void php_basic_spl_datastructures_splheap_rewind(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_TOP - mixed php_basic_spl_datastructures_splheap_top(SplHeap $splheap) // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_VALID - bool php_basic_spl_datastructures_splheap_valid(SplHeap $splheap) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (13) // SplHeap::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::extract() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::insert() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplHeap::isCorrupted() - PHP_7, PHP_8 // SplHeap::isEmpty() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::recoverFromCorruption() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::top() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplHeap::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // int // SplHeap - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // mixed // bool // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_COMPARE // ============================== PUBLIC // ============================== ABOUT // Compare elements in order to place them correctly in the heap while sifting up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_compare($splheap, $value1, $value2) { $return_splheap_compare = 0; // ========== SPLHEAP_COMPARE - BEGIN // ===== ABOUT // Compare elements in order to place them correctly in the heap while sifting up // ===== DESCRIPTION // Compare value1 with value2. // Warning: Throwing exceptions in SplHeap::compare() can corrupt the Heap and place it in a blocked state. You can unblock it by calling SplHeap::recoverFromCorruption(). However, some elements might not be placed correctly and it may hence break the heap-property. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // protected SplHeap::compare(mixed $value1, mixed $value2): int // ===== CODE $return_splheap_compare = $splheap->compare( $value1, // mixed value1 - The value of the first node being compared. $value2 // mixed value2 - The value of the second node being compared. ); // Return Values // Result of the comparison, positive integer if value1 is greater than value2, 0 if they are equal, negative integer otherwise. // Note: Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.compare.php // ========== SPLHEAP_COMPARE - END // SYNTAX: // int SplHeap::compare(mixed $value1, mixed $value2) return $return_splheap_compare; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_COMPARE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_COUNT // ============================== PUBLIC // ============================== ABOUT // Counts the number of elements in the heap. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_count($splheap) { $return_splheap_count = 0; // ========== SPLHEAP_COUNT - BEGIN // ===== ABOUT // Counts the number of elements in the heap // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::count(): int // ===== CODE $return_splheap_count = $splheap->count( // This function has no parameters. ); // Return Values // Returns the number of elements in the heap. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.count.php // ========== SPLHEAP_COUNT - END // SYNTAX: // int SplHeap::count() return $return_splheap_count; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_CURRENT // ============================== PUBLIC // ============================== ABOUT // Return current node pointed by the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_current($splheap) { $return_splheap_current = null; // ========== SPLHEAP_CURRENT - BEGIN // ===== ABOUT // Return current node pointed by the iterator // ===== DESCRIPTION // Get the current datastructure node. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::current(): mixed // ===== CODE $return_splheap_current = $splheap->current( // This function has no parameters. ); // Return Values // The current node value. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.current.php // ========== SPLHEAP_CURRENT - END // SYNTAX: // mixed SplHeap::current() return $return_splheap_current; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_EXTRACT // ============================== PUBLIC // ============================== ABOUT // Extracts a node from top of the heap and sift up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::extract() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_extract($splheap) { $return_splheap_extract = null; // ========== SPLHEAP_EXTRACT - BEGIN // ===== ABOUT // Extracts a node from top of the heap and sift up // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::extract(): mixed // ===== CODE $return_splheap_extract = $splheap->extract( // This function has no parameters. ); // Return Values // The value of the extracted node. // // Errors/Exceptions // Throws RuntimeException when the data-structure is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.extract.php // ========== SPLHEAP_EXTRACT - END // SYNTAX: // mixed SplHeap::extract() return $return_splheap_extract; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_EXTRACT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_INSERT // ============================== PUBLIC // ============================== ABOUT // Inserts an element in the heap by sifting it up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::insert() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_insert($splheap, $value) { $return_splheap_insert = false; // ========== SPLHEAP_INSERT - BEGIN // ===== ABOUT // Inserts an element in the heap by sifting it up // ===== DESCRIPTION // Insert value in the heap. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::insert(mixed $value): true // ===== CODE $return_splheap_insert = $splheap->insert( $value // mixed value - The value to insert. ); // Return Values // Always returns true. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.insert.php // ========== SPLHEAP_INSERT - END // SYNTAX: // bool SplHeap::insert(mixed $value) return $return_splheap_insert; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_INSERT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_ISCORRUPTED // ============================== OFFLINE // ============================== ABOUT // Tells if the heap is in a corrupted state. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::isCorrupted() - PHP_7, PHP_8 // ============================== CODE /* function php_basic_spl_datastructures_splheap_iscorrupted($splheap) { $return_splheap_iscorrupted = false; // ========== SPLHEAP_ISCORRUPTED - BEGIN // ===== ABOUT // Tells if the heap is in a corrupted state // ===== DESCRIPTION // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::isCorrupted(): bool // ===== CODE $return_splheap_iscorrupted = $splheap->isCorrupted( // This function has no parameters. ); // Return Values // Returns true if the heap is corrupted, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.iscorrupted.php // ========== SPLHEAP_ISCORRUPTED - END // SYNTAX: // bool SplHeap::isCorrupted() return $return_splheap_iscorrupted; // bool } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_ISCORRUPTED // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_ISEMPTY // ============================== PUBLIC // ============================== ABOUT // Checks whether the heap is empty. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::isEmpty() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_isempty($splheap) { $return_splheap_isempty = false; // ========== SPLHEAP_ISEMPTY - BEGIN // ===== ABOUT // Checks whether the heap is empty // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::isEmpty(): bool // ===== CODE $return_splheap_isempty = $splheap->isEmpty( // This function has no parameters. ); // Return Values // Returns whether the heap is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.isempty.php // ========== SPLHEAP_ISEMPTY - END // SYNTAX: // bool SplHeap::isEmpty() return $return_splheap_isempty; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_ISEMPTY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_KEY // ============================== PUBLIC // ============================== ABOUT // Return current node index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_key($splheap) { $return_splheap_key = 0; // ========== SPLHEAP_KEY - BEGIN // ===== ABOUT // Return current node index // ===== DESCRIPTION // This function returns the current node index // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::key(): int // ===== CODE $return_splheap_key = $splheap->key( // This function has no parameters. ); // Return Values // The current node index. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.key.php // ========== SPLHEAP_KEY - END // SYNTAX: // int SplHeap::key() return $return_splheap_key; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to the next node. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_next($splheap) { // ========== SPLHEAP_NEXT - BEGIN // ===== ABOUT // Move to the next node // ===== DESCRIPTION // Move to the next node. This will delete the top node of the heap. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::next(): void // ===== CODE $splheap->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.next.php // ========== SPLHEAP_NEXT - END // SYNTAX: // void SplHeap::next() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_RECOVERFROMCORRUPTION // ============================== PUBLIC // ============================== ABOUT // Recover from the corrupted state and allow further actions on the heap. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::recoverFromCorruption() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_recoverfromcorruption($splheap) { $return_splheap_recoverfromcorruption = false; // ========== SPLHEAP_RECOVERFROMCORRUPTION - BEGIN // ===== ABOUT // Recover from the corrupted state and allow further actions on the heap // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::recoverFromCorruption(): bool // ===== CODE $return_splheap_recoverfromcorruption = $splheap->recoverFromCorruption( // This function has no parameters. ); // Return Values // Always returns true. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.recoverfromcorruption.php // ========== SPLHEAP_RECOVERFROMCORRUPTION - END // SYNTAX: // bool SplHeap::recoverFromCorruption() return $return_splheap_recoverfromcorruption; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_RECOVERFROMCORRUPTION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind iterator back to the start (no-op). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_rewind($splheap) { // ========== SPLHEAP_REWIND - BEGIN // ===== ABOUT // Rewind iterator back to the start (no-op) // ===== DESCRIPTION // This rewinds the iterator to the beginning. This is a no-op for heaps as the iterator is virtual and in fact never moves from the top of the heap. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::rewind(): void // ===== CODE $splheap->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.rewind.php // ========== SPLHEAP_REWIND - END // SYNTAX: // void SplHeap::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_TOP // ============================== PUBLIC // ============================== ABOUT // Peeks at the node from the top of the heap. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::top() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_top($splheap) { $return_splheap_top = null; // ========== SPLHEAP_TOP - BEGIN // ===== ABOUT // Peeks at the node from the top of the heap // ===== DESCRIPTION // This function has no parameters. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::top(): mixed // ===== CODE $return_splheap_top = $splheap->top( // This function has no parameters. ); // Return Values // The value of the node on the top. // // Errors/Exceptions // Throws RuntimeException when the data-structure is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.top.php // ========== SPLHEAP_TOP - END // SYNTAX: // mixed SplHeap::top() return $return_splheap_top; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_TOP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the heap contains more nodes. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplHeap::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splheap_valid($splheap) { $return_splheap_valid = false; // ========== SPLHEAP_VALID - BEGIN // ===== ABOUT // Check whether the heap contains more nodes // ===== DESCRIPTION // Checks if the heap contains any more nodes. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplHeap::valid(): bool // ===== CODE $return_splheap_valid = $splheap->valid( // This function has no parameters. ); // Return Values // Returns true if the heap contains any more nodes, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splheap.valid.php // ========== SPLHEAP_VALID - END // SYNTAX: // bool SplHeap::valid() return $return_splheap_valid; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP_VALID // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLHEAP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLMAXHEAP // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLMAXHEAP_COMPARE - int php_basic_spl_datastructures_splmaxheap_compare(SplMaxHeap $splmaxheap, mixed $value1, mixed $value2) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplMaxHeap::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // int // SplMaxHeap - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // mixed // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLMAXHEAP_COMPARE // ============================== PUBLIC // ============================== ABOUT // Compare elements in order to place them correctly in the heap while sifting up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplMaxHeap::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splmaxheap_compare($splmaxheap, $value1, $value2) { $return_splmaxheap_compare = 0; // ========== SPLMAXHEAP_COMPARE - BEGIN // ===== ABOUT // Compare elements in order to place them correctly in the heap while sifting up // ===== DESCRIPTION // Compare value1 with value2. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // protected SplMaxHeap::compare(mixed $value1, mixed $value2): int // ===== CODE $return_splmaxheap_compare = $splmaxheap->compare( $value1, // mixed value1 - The value of the first node being compared. $value2 // mixed value2 - The value of the second node being compared. ); // Return Values // Result of the comparison, positive integer if value1 is greater than value2, 0 if they are equal, negative integer otherwise. // Note: Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splmaxheap.compare.php // ========== SPLMAXHEAP_COMPARE - END // SYNTAX: // int SplMaxHeap::compare(mixed $value1, mixed $value2) return $return_splmaxheap_compare; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLMAXHEAP_COMPARE // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLMAXHEAP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLMINHEAP // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLMINHEAP_COMPARE - int php_basic_spl_datastructures_splminheap_compare(SplMinHeap $splminheap, mixed $value1, mixed $value2) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplMinHeap::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // int // SplMinHeap - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // mixed // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLMINHEAP_COMPARE // ============================== PUBLIC // ============================== ABOUT // Compare elements in order to place them correctly in the heap while sifting up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplMinHeap::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splminheap_compare($splminheap, $value1, $value2) { $return_splminheap_compare = 0; // ========== SPLMINHEAP_COMPARE - BEGIN // ===== ABOUT // Compare elements in order to place them correctly in the heap while sifting up // ===== DESCRIPTION // Compare value1 with value2. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // protected SplMinHeap::compare(mixed $value1, mixed $value2): int // ===== CODE $return_splminheap_compare = $splminheap->compare( $value1, // mixed value1 - The value of the first node being compared. $value2 // mixed value2 - The value of the second node being compared. ); // Return Values // Result of the comparison, positive integer if value1 is lower than value2, 0 if they are equal, negative integer otherwise. // Note: Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splminheap.compare.php // ========== SPLMINHEAP_COMPARE - END // SYNTAX: // int SplMinHeap::compare(mixed $value1, mixed $value2) return $return_splminheap_compare; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLMINHEAP_COMPARE // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLMINHEAP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_COMPARE - int php_basic_spl_datastructures_splpriorityqueue_compare(SplPriorityQueue $splpriorityqueue, mixed $priority1, mixed $priority2) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_COUNT - int php_basic_spl_datastructures_splpriorityqueue_count(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_CURRENT - mixed php_basic_spl_datastructures_splpriorityqueue_current(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_EXTRACT - mixed php_basic_spl_datastructures_splpriorityqueue_extract(SplPriorityQueue $splpriorityqueue) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_GETEXTRACTFLAGS - int php_basic_spl_datastructures_splpriorityqueue_getextractflags(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_INSERT - bool php_basic_spl_datastructures_splpriorityqueue_insert(SplPriorityQueue $splpriorityqueue, mixed $value, mixed $priority) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_ISCORRUPTED - bool php_basic_spl_datastructures_splpriorityqueue_iscorrupted(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_ISEMPTY - bool php_basic_spl_datastructures_splpriorityqueue_isempty(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_KEY - int php_basic_spl_datastructures_splpriorityqueue_key(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_NEXT - void php_basic_spl_datastructures_splpriorityqueue_next(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_RECOVERFROMCORRUPTION - bool php_basic_spl_datastructures_splpriorityqueue_recoverfromcorruption(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_REWIND - void php_basic_spl_datastructures_splpriorityqueue_rewind(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_SETEXTRACTFLAGS - int php_basic_spl_datastructures_splpriorityqueue_setextractflags(SplPriorityQueue $splpriorityqueue, int $flags) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_TOP - mixed php_basic_spl_datastructures_splpriorityqueue_top(SplPriorityQueue $splpriorityqueue) // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_VALID - bool php_basic_spl_datastructures_splpriorityqueue_valid(SplPriorityQueue $splpriorityqueue) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (15) // SplPriorityQueue::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::extract() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplPriorityQueue::getExtractFlags() - PHP_7, PHP_8 // SplPriorityQueue::insert() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::isCorrupted() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::isEmpty() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::recoverFromCorruption() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::setExtractFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::top() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplPriorityQueue::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // int // SplPriorityQueue - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // mixed // bool // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_COMPARE // ============================== PUBLIC // ============================== ABOUT // Compare priorities in order to place elements correctly in the heap while sifting up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::compare() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_compare($splpriorityqueue, $priority1, $priority2) { $return_splpriorityqueue_compare = 0; // ========== SPLPRIORITYQUEUE_COMPARE - BEGIN // ===== ABOUT // Compare priorities in order to place elements correctly in the heap while sifting up // ===== DESCRIPTION // Compare priority1 with priority2. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::compare(mixed $priority1, mixed $priority2): int // ===== CODE $return_splpriorityqueue_compare = $splpriorityqueue->compare( $priority1, // mixed priority1 - The priority of the first node being compared. $priority2 // mixed priority2 - The priority of the second node being compared. ); // Return Values // Result of the comparison, positive integer if priority1 is greater than priority2, 0 if they are equal, negative integer otherwise. // Note: Multiple elements with the same priority will get dequeued in no particular order. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.compare.php // ========== SPLPRIORITYQUEUE_COMPARE - END // SYNTAX: // int SplPriorityQueue::compare(mixed $priority1, mixed $priority2) return $return_splpriorityqueue_compare; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_COMPARE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_COUNT // ============================== PUBLIC // ============================== ABOUT // Counts the number of elements in the queue. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_count($splpriorityqueue) { $return_splpriorityqueue_count = 0; // ========== SPLPRIORITYQUEUE_COUNT - BEGIN // ===== ABOUT // Counts the number of elements in the queue // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::count(): int // ===== CODE $return_splpriorityqueue_count = $splpriorityqueue->count( // This function has no parameters. ); // Return Values // Returns the number of elements in the queue. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.count.php // ========== SPLPRIORITYQUEUE_COUNT - END // SYNTAX: // int SplPriorityQueue::count() return $return_splpriorityqueue_count; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_CURRENT // ============================== PUBLIC // ============================== ABOUT // Return current node pointed by the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_current($splpriorityqueue) { $return_splpriorityqueue_current = null; // ========== SPLPRIORITYQUEUE_CURRENT - BEGIN // ===== ABOUT // Return current node pointed by the iterator // ===== DESCRIPTION // Get the current datastructure node. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::current(): mixed // ===== CODE $return_splpriorityqueue_current = $splpriorityqueue->current( // This function has no parameters. ); // Return Values // The value or priority (or both) of the current node, depending on the extract flag. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/function.abs.php // ========== SPLPRIORITYQUEUE_CURRENT - END // SYNTAX: // mixed SplPriorityQueue::current() return $return_splpriorityqueue_current; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_EXTRACT // ============================== PUBLIC // ============================== ABOUT // Extracts a node from top of the heap and sift up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::extract() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_extract($splpriorityqueue) { $return_splpriorityqueue_extract = null; // ========== SPLPRIORITYQUEUE_EXTRACT - BEGIN // ===== ABOUT // Extracts a node from top of the heap and sift up // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::extract(): mixed // ===== CODE $return_splpriorityqueue_extract = $splpriorityqueue->extract( // This function has no parameters. ); // Return Values // The value or priority (or both) of the extracted node, depending on the extract flag. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.extract.php // ========== SPLPRIORITYQUEUE_EXTRACT - END // SYNTAX: // mixed SplPriorityQueue::extract() return $return_splpriorityqueue_extract; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_EXTRACT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_GETEXTRACTFLAGS // ============================== OFFLINE // ============================== ABOUT // Get the flags of extraction. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::getExtractFlags() - PHP_7, PHP_8 // ============================== CODE /* function php_basic_spl_datastructures_splpriorityqueue_getextractflags($splpriorityqueue) { $return_splpriorityqueue_getextractflags = 0; // ========== SPLPRIORITYQUEUE_GETEXTRACTFLAGS - BEGIN // ===== ABOUT // Get the flags of extraction // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::getExtractFlags(): int // ===== CODE $return_splpriorityqueue_getextractflags = $splpriorityqueue->getExtractFlags( // This function has no parameters. ); // Return Values // Returns the flags of extraction. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.getextractflags.php // ========== SPLPRIORITYQUEUE_GETEXTRACTFLAGS - END // SYNTAX: // int SplPriorityQueue::getExtractFlags() return $return_splpriorityqueue_getextractflags; // int } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_GETEXTRACTFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_INSERT // ============================== PUBLIC // ============================== ABOUT // Inserts an element in the queue by sifting it up. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::insert() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_insert($splpriorityqueue, $value, $priority) { $return_splpriorityqueue_insert = false; // ========== SPLPRIORITYQUEUE_INSERT - BEGIN // ===== ABOUT // Inserts an element in the queue by sifting it up // ===== DESCRIPTION // Insert value with the priority priority in the queue. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::insert(mixed $value, mixed $priority): true // ===== CODE $return_splpriorityqueue_insert = $splpriorityqueue->insert( $value, // mixed value - The value to insert. $priority // mixed priority - The associated priority. ); // Return Values // Always returns true. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.insert.php // ========== SPLPRIORITYQUEUE_INSERT - END // SYNTAX: // bool SplPriorityQueue::insert(mixed $value, mixed $priority) return $return_splpriorityqueue_insert; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_INSERT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_ISCORRUPTED // ============================== PUBLIC // ============================== ABOUT // Tells if the priority queue is in a corrupted state. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::isCorrupted() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_iscorrupted($splpriorityqueue) { $return_splpriorityqueue_iscorrupted = false; // ========== SPLPRIORITYQUEUE_ISCORRUPTED - BEGIN // ===== ABOUT // Tells if the priority queue is in a corrupted state // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::isCorrupted(): bool // ===== CODE $return_splpriorityqueue_iscorrupted = $splpriorityqueue->isCorrupted( // This function has no parameters. ); // Return Values // Returns true if the priority queue is corrupted, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.iscorrupted.php // ========== SPLPRIORITYQUEUE_ISCORRUPTED - END // SYNTAX: // bool SplPriorityQueue::isCorrupted() return $return_splpriorityqueue_iscorrupted; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_ISCORRUPTED // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_ISEMPTY // ============================== PUBLIC // ============================== ABOUT // Checks whether the queue is empty. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::isEmpty() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_isempty($splpriorityqueue) { $return_splpriorityqueue_isempty = false; // ========== SPLPRIORITYQUEUE_ISEMPTY - BEGIN // ===== ABOUT // Checks whether the queue is empty // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::isEmpty(): bool // ===== CODE $return_splpriorityqueue_isempty = $splpriorityqueue->isEmpty( // This function has no parameters. ); // Return Values // Returns whether the queue is empty. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.isempty.php // ========== SPLPRIORITYQUEUE_ISEMPTY - END // SYNTAX: // bool SplPriorityQueue::isEmpty() return $return_splpriorityqueue_isempty; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_ISEMPTY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_KEY // ============================== PUBLIC // ============================== ABOUT // Return current node index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_key($splpriorityqueue) { $return_splpriorityqueue_key = 0; // ========== SPLPRIORITYQUEUE_KEY - BEGIN // ===== ABOUT // Return current node index // ===== DESCRIPTION // This function returns the current node index // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::key(): int // ===== CODE $return_splpriorityqueue_key = $splpriorityqueue->key( // This function has no parameters. ); // Return Values // The current node index. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.key.php // ========== SPLPRIORITYQUEUE_KEY - END // SYNTAX: // int SplPriorityQueue::key() return $return_splpriorityqueue_key; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to the next node. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_next($splpriorityqueue) { // ========== SPLPRIORITYQUEUE_NEXT - BEGIN // ===== ABOUT // Move to the next node // ===== DESCRIPTION // Extracts the top node from the queue. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::next(): void // ===== CODE $splpriorityqueue->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.next.php // ========== SPLPRIORITYQUEUE_NEXT - END // SYNTAX: // void SplPriorityQueue::next() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_RECOVERFROMCORRUPTION // ============================== PUBLIC // ============================== ABOUT // Recover from the corrupted state and allow further actions on the queue. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::recoverFromCorruption() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_recoverfromcorruption($splpriorityqueue) { $return_splpriorityqueue_recoverfromcorruption = false; // ========== SPLPRIORITYQUEUE_RECOVERFROMCORRUPTION - BEGIN // ===== ABOUT // Recover from the corrupted state and allow further actions on the queue // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::recoverFromCorruption(): bool // ===== CODE $return_splpriorityqueue_recoverfromcorruption = $splpriorityqueue->recoverFromCorruption( // This function has no parameters. ); // Return Values // Always returns true. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.recoverfromcorruption.php // ========== SPLPRIORITYQUEUE_RECOVERFROMCORRUPTION - END // SYNTAX: // bool SplPriorityQueue::recoverFromCorruption() return $return_splpriorityqueue_recoverfromcorruption; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_RECOVERFROMCORRUPTION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind iterator back to the start (no-op). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_rewind($splpriorityqueue) { // ========== SPLPRIORITYQUEUE_REWIND - BEGIN // ===== ABOUT // Rewind iterator back to the start (no-op) // ===== DESCRIPTION // This rewinds the iterator to the beginning. This is a no-op for heaps as the iterator is virtual and in fact never moves from the top of the heap. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::rewind(): void // ===== CODE $splpriorityqueue->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://php.net/manual/en/splpriorityqueue.rewind.php // ========== SPLPRIORITYQUEUE_REWIND - END // SYNTAX: // void SplPriorityQueue::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_SETEXTRACTFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets the mode of extraction. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::setExtractFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_setextractflags($splpriorityqueue, $flags) { $return_splpriorityqueue_setextractflags = 0; // ========== SPLPRIORITYQUEUE_SETEXTRACTFLAGS - BEGIN // ===== ABOUT // Sets the mode of extraction // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::setExtractFlags(int $flags): int // ===== CODE $return_splpriorityqueue_setextractflags = $splpriorityqueue->setExtractFlags( $flags // int flags - Defines what is extracted by SplPriorityQueue::current(), SplPriorityQueue::top() and SplPriorityQueue::extract(). // * SplPriorityQueue::EXTR_DATA (0x00000001) : Extract the data // * SplPriorityQueue::EXTR_PRIORITY (0x00000002) : Extract the priority // * SplPriorityQueue::EXTR_BOTH (0x00000003) : Extract an array containing both // The default mode is SplPriorityQueue::EXTR_DATA. ); // Return Values // Returns the flags of extraction. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.setextractflags.php // ========== SPLPRIORITYQUEUE_SETEXTRACTFLAGS - END // SYNTAX: // int SplPriorityQueue::setExtractFlags(int $flags) return $return_splpriorityqueue_setextractflags; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_SETEXTRACTFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_TOP // ============================== PUBLIC // ============================== ABOUT // Peeks at the node from the top of the queue. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::top() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_top($splpriorityqueue) { $return_splpriorityqueue_top = null; // ========== SPLPRIORITYQUEUE_TOP - BEGIN // ===== ABOUT // Peeks at the node from the top of the queue // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::top(): mixed // ===== CODE $return_splpriorityqueue_top = $splpriorityqueue->top( // This function has no parameters. ); // Return Values // The value or priority (or both) of the top node, depending on the extract flag. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.top.php // ========== SPLPRIORITYQUEUE_TOP - END // SYNTAX: // mixed SplPriorityQueue::top() return $return_splpriorityqueue_top; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_TOP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the queue contains more nodes. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplPriorityQueue::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splpriorityqueue_valid($splpriorityqueue) { $return_splpriorityqueue_valid = false; // ========== SPLPRIORITYQUEUE_VALID - BEGIN // ===== ABOUT // Check whether the queue contains more nodes // ===== DESCRIPTION // Checks if the queue contains any more nodes. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplPriorityQueue::valid(): bool // ===== CODE $return_splpriorityqueue_valid = $splpriorityqueue->valid( // This function has no parameters. ); // Return Values // Returns true if the queue contains any more nodes, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splpriorityqueue.valid.php // ========== SPLPRIORITYQUEUE_VALID - END // SYNTAX: // bool SplPriorityQueue::valid() return $return_splpriorityqueue_valid; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE_VALID // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLPRIORITYQUEUE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_CONSTRUCT - SplFixedArray php_basic_spl_datastructures_splfixedarray_construct(int $size = 0) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_COUNT - int php_basic_spl_datastructures_splfixedarray_count(SplFixedArray $splfixedarray) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_CURRENT - mixed php_basic_spl_datastructures_splfixedarray_current(SplFixedArray $splfixedarray) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_FROMARRAY - SplFixedArray php_basic_spl_datastructures_splfixedarray_fromarray(SplFixedArray $splfixedarray, array $array, bool $preserveKeys = true) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_GETITERATOR - Iterator php_basic_spl_datastructures_splfixedarray_getiterator(SplFixedArray $splfixedarray) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_GETSIZE - int php_basic_spl_datastructures_splfixedarray_getsize(SplFixedArray $splfixedarray) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_JSONSERIALIZE - mixed php_basic_spl_datastructures_splfixedarray_jsonserialize(SplFixedArray $splfixedarray) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_KEY - int php_basic_spl_datastructures_splfixedarray_key(SplFixedArray $splfixedarray) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_NEXT - void php_basic_spl_datastructures_splfixedarray_next(SplFixedArray $splfixedarray) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETEXISTS - bool php_basic_spl_datastructures_splfixedarray_offsetexists(SplFixedArray $splfixedarray, int $index) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETGET - mixed php_basic_spl_datastructures_splfixedarray_offsetget(SplFixedArray $splfixedarray, int $index) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETSET - void php_basic_spl_datastructures_splfixedarray_offsetset(SplFixedArray $splfixedarray, int $index, mixed $value) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETUNSET - void php_basic_spl_datastructures_splfixedarray_offsetunset(SplFixedArray $splfixedarray, int $index) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_REWIND - void php_basic_spl_datastructures_splfixedarray_rewind(SplFixedArray $splfixedarray) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_SERIALIZE - array php_basic_spl_datastructures_splfixedarray_serialize(SplFixedArray $splfixedarray) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_SETSIZE - bool php_basic_spl_datastructures_splfixedarray_setsize(SplFixedArray $splfixedarray, int $size) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_TOARRAY - array php_basic_spl_datastructures_splfixedarray_toarray(SplFixedArray $splfixedarray) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_UNSERIALIZE - void php_basic_spl_datastructures_splfixedarray_unserialize(SplFixedArray $splfixedarray, array $data) // OFFLINE | PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_VALID - bool php_basic_spl_datastructures_splfixedarray_valid(SplFixedArray $splfixedarray) // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_WAKEUP - void php_basic_spl_datastructures_splfixedarray_wakeup(SplFixedArray $splfixedarray) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (20) // SplFixedArray::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFixedArray::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplFixedArray::current() - PHP_5 >= PHP_5_3_0, PHP_7 // SplFixedArray::fromArray() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplFixedArray::getIterator() - PHP_8 // SplFixedArray::getSize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplFixedArray::jsonSerialize() - PHP_8 >= PHP_8_1_0 // OFFLINE | SplFixedArray::key() - PHP_5 >= PHP_5_3_0, PHP_7 // OFFLINE | SplFixedArray::next() - PHP_5 >= PHP_5_3_0, PHP_7 // SplFixedArray::offsetExists() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFixedArray::offsetGet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFixedArray::offsetSet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFixedArray::offsetUnset() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplFixedArray::rewind() - PHP_5 >= PHP_5_3_0, PHP_7 // OFFLINE | SplFixedArray::__serialize() - PHP_8 >= PHP_8_2_0 // SplFixedArray::setSize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplFixedArray::toArray() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // OFFLINE | SplFixedArray::__unserialize() - PHP_8 >= PHP_8_2_0 // OFFLINE | SplFixedArray::valid() - PHP_5 >= PHP_5_3_0, PHP_7 // SplFixedArray::__wakeup() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (7) // SplFixedArray - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // int // mixed // array // bool // Iterator - PHP_5, PHP_7, PHP_8 // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a new fixed array. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_construct($size = 0) { $return_splfixedarray_construct = null; // ========== SPLFIXEDARRAY_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a new fixed array // ===== DESCRIPTION // Initializes a fixed array with a number of null values equal to size. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::__construct(int $size = 0) // ===== CODE $return_splfixedarray_construct = new SplFixedArray( $size // int size - The size of the fixed array. This expects a number between 0 and PHP_INT_MAX. ); // Return // SplFixedArray // // Errors/Exceptions // Throws a ValueError when size is a negative integer. // // Changelog // Version - Description // 8.0.0 - Now throws a ValueError if size is a negative; previously it threw a InvalidArgumentException. // // [examples] // Examples // [example] // Example #1 SplFixedArray::__construct() example // [php] // $array = new SplFixedArray(5); // // $array[1] = 2; // $array[4] = "foo"; // // foreach($array as $v) { // var_dump($v); // } // [/php] // The above example will output: // [result] // NULL // int(2) // NULL // NULL // string(3) "foo" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.construct.php // ========== SPLFIXEDARRAY_CONSTRUCT - END // SYNTAX: // SplFixedArray SplFixedArray::__construct(int $size = 0) return $return_splfixedarray_construct; // SplFixedArray } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_COUNT // ============================== PUBLIC // ============================== ABOUT // Returns the size of the array. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_count($splfixedarray) { $return_splfixedarray_count = 0; // ========== SPLFIXEDARRAY_COUNT - BEGIN // ===== ABOUT // Returns the size of the array // ===== DESCRIPTION // Returns the size of the array. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::count(): int // ===== CODE $return_splfixedarray_count = $splfixedarray->count( // This function has no parameters. ); // Return Values // Returns the size of the array. // // [examples] // Examples // [example] // Example #1 SplFixedArray::count() example // [php] // $array = new SplFixedArray(5); // echo $array->count() . "\n"; // echo count($array) . "\n"; // [/php] // The above example will output: // [result] // 5 // 5 // [/result] // [/example] // [/examples] // // Notes // Note: This method is functionally equivalent to SplFixedArray::getSize(). // Note: The count of elements is always equal to the set size because all values are initially initialized with null. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.count.php // ========== SPLFIXEDARRAY_COUNT - END // SYNTAX: // int SplFixedArray::count() return $return_splfixedarray_count; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_CURRENT // ============================== OFFLINE // ============================== ABOUT // Return current array entry. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // SplFixedArray::current() - PHP_5 >= PHP_5_3_0, PHP_7 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_current($splfixedarray) { $return_splfixedarray_current = null; // ========== SPLFIXEDARRAY_CURRENT - BEGIN // ===== ABOUT // Return current array entry // ===== DESCRIPTION // Get the current array element. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7 // ===== SYNTAX // public SplFixedArray::current(): mixed // ===== CODE $return_splfixedarray_current = $splfixedarray->current( // This function has no parameters. ); // Return Values // The current element value. // // Errors/Exceptions // Throws RuntimeException when the internal array pointer points to an invalid index or is out of bounds. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.current.php // ========== SPLFIXEDARRAY_CURRENT - END // SYNTAX: // mixed SplFixedArray::current() return $return_splfixedarray_current; // mixed } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_FROMARRAY // ============================== PUBLIC // ============================== ABOUT // Import a PHP array in a SplFixedArray instance. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::fromArray() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_fromarray($splfixedarray, $array, $preserveKeys = true) { $return_splfixedarray_fromarray = null; // ========== SPLFIXEDARRAY_FROMARRAY - BEGIN // ===== ABOUT // Import a PHP array in a SplFixedArray instance // ===== DESCRIPTION // Import the PHP array array in a new SplFixedArray instance // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public static SplFixedArray::fromArray(array $array, bool $preserveKeys = true): SplFixedArray // ===== CODE $return_splfixedarray_fromarray = $splfixedarray->fromArray( $array, // array array - The array to import. $preserveKeys // bool preserveKeys - Try to save the numeric indexes used in the original array. ); // Return Values // Returns an instance of SplFixedArray containing the array content. // // [examples] // Examples // [example] // Example #1 SplFixedArray::fromArray() example // [php] // $fa = SplFixedArray::fromArray(array(1 => 1, 0 => 2, 3 => 3)); // // var_dump($fa); // // $fa = SplFixedArray::fromArray(array(1 => 1, 0 => 2, 3 => 3), false); // // var_dump($fa); // [/php] // The above example will output: // [result] // object(SplFixedArray)#1 (4) { // [0]=> // int(2) // [1]=> // int(1) // [2]=> // NULL // [3]=> // int(3) // } // object(SplFixedArray)#2 (3) { // [0]=> // int(1) // [1]=> // int(2) // [2]=> // int(3) // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.fromarray.php // ========== SPLFIXEDARRAY_FROMARRAY - END // SYNTAX: // SplFixedArray SplFixedArray::fromArray(array $array, bool $preserveKeys = true) return $return_splfixedarray_fromarray; // SplFixedArray } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_FROMARRAY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_GETITERATOR // ============================== OFFLINE // ============================== ABOUT // Retrieve the iterator to go through the array. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::getIterator() - PHP_8 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_getiterator($splfixedarray) { $return_splfixedarray_getiterator = null; // ========== SPLFIXEDARRAY_GETITERATOR - BEGIN // ===== ABOUT // Retrieve the iterator to go through the array // ===== DESCRIPTION // Returns the iterator to go through the array. // ===== SUPPORTED // PHP_8 // ===== SYNTAX // public SplFixedArray::getIterator(): Iterator // ===== CODE $return_splfixedarray_getiterator = $splfixedarray->getIterator( // This function has no parameters. ); // Return Values // An instance of an object implementing Iterator to go through the array. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.getiterator.php // ========== SPLFIXEDARRAY_GETITERATOR - END // SYNTAX: // Iterator SplFixedArray::getIterator() return $return_splfixedarray_getiterator; // Iterator } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_GETITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_GETSIZE // ============================== PUBLIC // ============================== ABOUT // Gets the size of the array. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::getSize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_getsize($splfixedarray) { $return_splfixedarray_getsize = 0; // ========== SPLFIXEDARRAY_GETSIZE - BEGIN // ===== ABOUT // Gets the size of the array // ===== DESCRIPTION // Gets the size of the array. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::getSize(): int // ===== CODE $return_splfixedarray_getsize = $splfixedarray->getSize( // This function has no parameters. ); // Return Values // Returns the size of the array, as an int. // // [examples] // Examples // [example] // Example #1 SplFixedArray::getSize() example // [php] // $array = new SplFixedArray(5); // echo $array->getSize()."\n"; // $array->setSize(10); // echo $array->getSize()."\n"; // [/php] // The above example will output: // [result] // 5 // 10 // [/result] // [/example] // [/examples] // // Notes // Note: This method is functionally equivalent to SplFixedArray::count() // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.getsize.php // ========== SPLFIXEDARRAY_GETSIZE - END // SYNTAX: // int SplFixedArray::getSize() return $return_splfixedarray_getsize; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_GETSIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_JSONSERIALIZE // ============================== OFFLINE // ============================== ABOUT // Returns a representation that can be converted to JSON. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::jsonSerialize() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_jsonserialize($splfixedarray) { $return_splfixedarray_jsonserialize = null; // ========== SPLFIXEDARRAY_JSONSERIALIZE - BEGIN // ===== ABOUT // Returns a representation that can be converted to JSON // ===== DESCRIPTION // Serializes the array to a value that can be serialized natively by json_encode(). // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public SplFixedArray::jsonSerialize(): mixed // ===== CODE $return_splfixedarray_jsonserialize = $splfixedarray->jsonSerialize( // This function has no parameters. ); // Return Values // Returns array data which can be serialized by json_encode(), which is a value of any type other than a resource. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.jsonserialize.php // ========== SPLFIXEDARRAY_JSONSERIALIZE - END // SYNTAX: // mixed SplFixedArray::jsonSerialize() return $return_splfixedarray_jsonserialize; // mixed } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_JSONSERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_KEY // ============================== OFFLINE // ============================== ABOUT // Return current array index. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // SplFixedArray::key() - PHP_5 >= PHP_5_3_0, PHP_7 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_key($splfixedarray) { $return_splfixedarray_key = 0; // ========== SPLFIXEDARRAY_KEY - BEGIN // ===== ABOUT // Return current array index // ===== DESCRIPTION // Returns the current array index. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7 // ===== SYNTAX // public SplFixedArray::key(): int // ===== CODE $return_splfixedarray_key = $splfixedarray->key( // This function has no parameters. ); // Return Values // The current array index. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.key.php // ========== SPLFIXEDARRAY_KEY - END // SYNTAX: // int SplFixedArray::key() return $return_splfixedarray_key; // int } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_NEXT // ============================== OFFLINE // ============================== ABOUT // Move to next entry. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // SplFixedArray::next() - PHP_5 >= PHP_5_3_0, PHP_7 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_next($splfixedarray) { // ========== SPLFIXEDARRAY_NEXT - BEGIN // ===== ABOUT // Move to next entry // ===== DESCRIPTION // Move the iterator to the next array entry. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7 // ===== SYNTAX // public SplFixedArray::next(): void // ===== CODE $splfixedarray->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.next.php // ========== SPLFIXEDARRAY_NEXT - END // SYNTAX: // void SplFixedArray::next() // Return: void } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETEXISTS // ============================== PUBLIC // ============================== ABOUT // Returns whether the requested index exists. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::offsetExists() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_offsetexists($splfixedarray, $index) { $return_splfixedarray_offsetexists = false; // ========== SPLFIXEDARRAY_OFFSETEXISTS - BEGIN // ===== ABOUT // Returns whether the requested index exists // ===== DESCRIPTION // Checks whether the requested index index exists. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::offsetExists(int $index): bool // ===== CODE $return_splfixedarray_offsetexists = $splfixedarray->offsetExists( $index // int index - The index being checked. ); // Return Values // true if the requested index exists, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.offsetexists.php // ========== SPLFIXEDARRAY_OFFSETEXISTS - END // SYNTAX: // bool SplFixedArray::offsetExists(int $index) return $return_splfixedarray_offsetexists; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETEXISTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETGET // ============================== PUBLIC // ============================== ABOUT // Returns the value at the specified index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::offsetGet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_offsetget($splfixedarray, $index) { $return_splfixedarray_offsetget = null; // ========== SPLFIXEDARRAY_OFFSETGET - BEGIN // ===== ABOUT // Returns the value at the specified index // ===== DESCRIPTION // Returns the value at the index index. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::offsetGet(int $index): mixed // ===== CODE $return_splfixedarray_offsetget = $splfixedarray->offsetGet( $index // int index - The index with the value. ); // Return Values // The value at the specified index. // // Errors/Exceptions // Throws RuntimeException when index is outside the defined size of the array or when index cannot be parsed as an integer. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-17) // URL: https://www.php.net/manual/en/splfixedarray.offsetget.php // ========== SPLFIXEDARRAY_OFFSETGET - END // SYNTAX: // mixed SplFixedArray::offsetGet(int $index) return $return_splfixedarray_offsetget; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETGET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETSET // ============================== PUBLIC // ============================== ABOUT // Sets a new value at a specified index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::offsetSet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_offsetset($splfixedarray, $index, $value) { // ========== SPLFIXEDARRAY_OFFSETSET - BEGIN // ===== ABOUT // Sets a new value at a specified index // ===== DESCRIPTION // Sets the value at the specified index to value. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::offsetSet(int $index, mixed $value): void // ===== CODE $splfixedarray->offsetSet( $index, // int index - The index being set. $value // mixed value - The new value for the index. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws RuntimeException when index is outside the defined size of the array or when index cannot be parsed as an integer. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-16) // URL: https://www.php.net/manual/en/splfixedarray.offsetset.php // ========== SPLFIXEDARRAY_OFFSETSET - END // SYNTAX: // void SplFixedArray::offsetSet(int $index, mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETUNSET // ============================== PUBLIC // ============================== ABOUT // Unsets the value at the specified $index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::offsetUnset() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_offsetunset($splfixedarray, $index) { // ========== SPLFIXEDARRAY_OFFSETUNSET - BEGIN // ===== ABOUT // Unsets the value at the specified $index // ===== DESCRIPTION // Unsets the value at the specified index. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::offsetUnset(int $index): void // ===== CODE $splfixedarray->offsetUnset( $index // int $index - The index being unset. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws RuntimeException when index is outside the defined size of the array or when index cannot be parsed as an integer. // // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.offsetunset.php // ========== SPLFIXEDARRAY_OFFSETUNSET - END // SYNTAX: // void SplFixedArray::offsetUnset(int $index) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_OFFSETUNSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_REWIND // ============================== OFFLINE // ============================== ABOUT // Rewind iterator back to the start. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // SplFixedArray::rewind() - PHP_5 >= PHP_5_3_0, PHP_7 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_rewind($splfixedarray) { // ========== SPLFIXEDARRAY_REWIND - BEGIN // ===== ABOUT // Rewind iterator back to the start // ===== DESCRIPTION // Rewinds the iterator to the beginning. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7 // ===== SYNTAX // public SplFixedArray::rewind(): void // ===== CODE $splfixedarray->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.rewind.php // ========== SPLFIXEDARRAY_REWIND - END // SYNTAX: // void SplFixedArray::rewind() // Return: void } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_SERIALIZE // ============================== OFFLINE // ============================== ABOUT // Serializes the SplFixedArray object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::__serialize() - PHP_8 >= PHP_8_2_0 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_serialize($splfixedarray) { $return_splfixedarray_serialize = null; // ========== SPLFIXEDARRAY_SERIALIZE - BEGIN // ===== ABOUT // Serializes the SplFixedArray object // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_8 >= PHP_8_2_0 // ===== SYNTAX // public SplFixedArray::__serialize(): array // ===== CODE $return_splfixedarray_serialize = $splfixedarray->__serialize( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.serialize.php // ========== SPLFIXEDARRAY_SERIALIZE - END // SYNTAX: // array SplFixedArray::__serialize() return $return_splfixedarray_serialize; // array } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_SERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_SETSIZE // ============================== PUBLIC // ============================== ABOUT // Change the size of an array. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::setSize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_setsize($splfixedarray, $size) { $return_splfixedarray_setsize = false; // ========== SPLFIXEDARRAY_SETSIZE - BEGIN // ===== ABOUT // Change the size of an array // ===== DESCRIPTION // Change the size of an array to the new size of size. If size is less than the current array size, any values after the new size will be discarded. If size is greater than the current array size, the array will be padded with null values. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::setSize(int $size): bool // ===== CODE $return_splfixedarray_setsize = $splfixedarray->setSize( $size // int size - The new array size. This should be a value between 0 and PHP_INT_MAX. ); // Return Values // Returns true on success or false on failure. // // Errors/Exceptions // Throws InvalidArgumentException when size is less than zero. // Raises E_WARNING when size cannot be used as a number. // // [examples] // Examples // [example] // Example #1 SplFixedArray::setSize() example // [php] // $array = new SplFixedArray(5); // echo $array->getSize()."\n"; // $array->setSize(10); // echo $array->getSize()."\n"; // [/php] // The above example will output: // [result] // 5 // 10 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.setsize.php // ========== SPLFIXEDARRAY_SETSIZE - END // SYNTAX: // bool SplFixedArray::setSize(int $size) return $return_splfixedarray_setsize; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_SETSIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_TOARRAY // ============================== PUBLIC // ============================== ABOUT // Returns a PHP array from the fixed array. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::toArray() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_toarray($splfixedarray) { $return_splfixedarray_toarray = null; // ========== SPLFIXEDARRAY_TOARRAY - BEGIN // ===== ABOUT // Returns a PHP array from the fixed array // ===== DESCRIPTION // Returns a PHP array from the fixed array. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::toArray(): array // ===== CODE $return_splfixedarray_toarray = $splfixedarray->toArray( // This function has no parameters. ); // Return Values // Returns a PHP array, similar to the fixed array. // // [examples] // Examples // [example] // Example #1 SplFixedArray::toArray() example // [php] // $fa = new SplFixedArray(3); // $fa[0] = 0; // $fa[2] = 2; // var_dump($fa->toArray()); // [/php] // The above example will output: // [result] // array(3) { // [0]=> // int(0) // [1]=> // NULL // [2]=> // int(2) // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.toarray.php // ========== SPLFIXEDARRAY_TOARRAY - END // SYNTAX: // array SplFixedArray::toArray() return $return_splfixedarray_toarray; // array } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_TOARRAY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_UNSERIALIZE // ============================== OFFLINE // ============================== ABOUT // Deserializes the data parameter into an SplFixedArray object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::__unserialize() - PHP_8 >= PHP_8_2_0 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_unserialize($splfixedarray, $data) { // ========== SPLFIXEDARRAY_UNSERIALIZE - BEGIN // ===== ABOUT // Deserializes the data parameter into an SplFixedArray object // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_8 >= PHP_8_2_0 // ===== SYNTAX // public SplFixedArray::__unserialize(array $data): void // ===== CODE $splfixedarray->__unserialize( $data // array data - The value being deserialized. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.unserialize.php // ========== SPLFIXEDARRAY_UNSERIALIZE - END // SYNTAX: // void SplFixedArray::__unserialize(array $data) // Return: void } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_UNSERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_VALID // ============================== OFFLINE // ============================== ABOUT // Check whether the array contains more elements. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // SplFixedArray::valid() - PHP_5 >= PHP_5_3_0, PHP_7 // ============================== CODE /* function php_basic_spl_datastructures_splfixedarray_valid($splfixedarray) { $return_splfixedarray_valid = false; // ========== SPLFIXEDARRAY_VALID - BEGIN // ===== ABOUT // Check whether the array contains more elements // ===== DESCRIPTION // Checks if the array contains any more elements. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7 // ===== SYNTAX // public SplFixedArray::valid(): bool // ===== CODE $return_splfixedarray_valid = $splfixedarray->valid( // This function has no parameters. ); // Return Values // Returns true if the array contains any more elements, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.valid.php // ========== SPLFIXEDARRAY_VALID - END // SYNTAX: // bool SplFixedArray::valid() return $return_splfixedarray_valid; // bool } */ // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_VALID // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_WAKEUP // ============================== PUBLIC // ============================== ABOUT // Reinitialises the array after being unserialised. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFixedArray::__wakeup() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splfixedarray_wakeup($splfixedarray) { // ========== SPLFIXEDARRAY_WAKEUP - BEGIN // ===== ABOUT // Reinitialises the array after being unserialised // ===== DESCRIPTION // Reinitialises the array after being unserialised. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFixedArray::__wakeup(): void // ===== CODE $splfixedarray->__wakeup( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/splfixedarray.wakeup.php // ========== SPLFIXEDARRAY_WAKEUP - END // SYNTAX: // void SplFixedArray::__wakeup() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY_WAKEUP // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLFIXEDARRAY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE // ============================== PUBLIC // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_ADDALL - int php_basic_spl_datastructures_splobjectstorage_addall(SplObjectStorage $storage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_ATTACH - void php_basic_spl_datastructures_splobjectstorage_attach(SplObjectStorage $splobjectstorage, object $object, mixed $info = null) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_CONTAINS - bool php_basic_spl_datastructures_splobjectstorage_contains(SplObjectStorage $splobjectstorage, object $object) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_COUNT - int php_basic_spl_datastructures_splobjectstorage_count(SplObjectStorage $splobjectstorage, int $mode = COUNT_NORMAL) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_CURRENT - object php_basic_spl_datastructures_splobjectstorage_current(SplObjectStorage $splobjectstorage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_DETACH - void php_basic_spl_datastructures_splobjectstorage_detach(SplObjectStorage $splobjectstorage, object $object) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_GETHASH - string php_basic_spl_datastructures_splobjectstorage_gethash(SplObjectStorage $splobjectstorage, object $object) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_GETINFO - mixed php_basic_spl_datastructures_splobjectstorage_getinfo(SplObjectStorage $splobjectstorage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_KEY - int php_basic_spl_datastructures_splobjectstorage_key(SplObjectStorage $splobjectstorage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_NEXT - void php_basic_spl_datastructures_splobjectstorage_next(SplObjectStorage $splobjectstorage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETEXISTS - bool php_basic_spl_datastructures_splobjectstorage_offsetexists(SplObjectStorage $splobjectstorage, object $object) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETSET - void php_basic_spl_datastructures_splobjectstorage_offsetset(SplObjectStorage $splobjectstorage, object $object, mixed $info = null) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETUNSET - void php_basic_spl_datastructures_splobjectstorage_offsetunset(SplObjectStorage $splobjectstorage, object $object) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REMOVEALL - int php_basic_spl_datastructures_splobjectstorage_removeall(SplObjectStorage $splobjectstorage, SplObjectStorage $storage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REMOVEALLEXCEPT - int php_basic_spl_datastructures_splobjectstorage_removeallexcept(SplObjectStorage $splobjectstorage, SplObjectStorage $storage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REWIND - void php_basic_spl_datastructures_splobjectstorage_rewind(SplObjectStorage $splobjectstorage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_SERIALIZE - string php_basic_spl_datastructures_splobjectstorage_serialize(SplObjectStorage $splobjectstorage) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_SETINFO - void php_basic_spl_datastructures_splobjectstorage_setinfo(SplObjectStorage $splobjectstorage, mixed $info) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_UNSERIALIZE - void php_basic_spl_datastructures_splobjectstorage_unserialize(SplObjectStorage $splobjectstorage, string $data) // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_VALID - bool php_basic_spl_datastructures_splobjectstorage_valid(SplObjectStorage $splobjectstorage) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (20) // SplObjectStorage::addAll() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::attach() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::contains() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::count() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::detach() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::getHash() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // SplObjectStorage::getInfo() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::offsetExists() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::offsetSet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::offsetUnset() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::removeAll() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::removeAllExcept() - PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // SplObjectStorage::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplObjectStorage::serialize() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // SplObjectStorage::setInfo() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // SplObjectStorage::unserialize() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // SplObjectStorage::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (7) // int // SplObjectStorage - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // void // object // mixed // bool // string // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_ADDALL // ============================== PUBLIC // ============================== ABOUT // Adds all objects from another storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::addAll() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_addall($splobjectstorage) { $return_splobjectstorage_addall = 0; // ========== SPLOBJECTSTORAGE_ADDALL - BEGIN // ===== ABOUT // Adds all objects from another storage // ===== DESCRIPTION // Adds all objects-data pairs from a different storage in the current storage. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::addAll(SplObjectStorage $storage): int // ===== CODE $return_splobjectstorage_addall = $splobjectstorage->addAll( $storage // SplObjectStorage storage - The storage you want to import. ); // Return Values // The number of objects in the storage. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::addAll() example // [php] // $o = new stdClass; // $a = new SplObjectStorage(); // $a[$o] = "hello"; // // $b = new SplObjectStorage(); // $b->addAll($a); // echo $b[$o]."\n"; // [/php] // The above example will output something similar to: // [result] // hello // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.addall.php // ========== SPLOBJECTSTORAGE_ADDALL - END // SYNTAX: // int SplObjectStorage::addAll(SplObjectStorage $storage) return $return_splobjectstorage_addall; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_ADDALL // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_ATTACH // ============================== PUBLIC // ============================== ABOUT // Adds an object in the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::attach() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_attach($splobjectstorage, $object, $info = null) { // ========== SPLOBJECTSTORAGE_ATTACH - BEGIN // ===== ABOUT // Adds an object in the storage // ===== DESCRIPTION // Adds an object inside the storage, and optionally associate it to some data. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::attach(object $object, mixed $info = null): void // ===== CODE $splobjectstorage->attach( $object, // object object - The object to add. $info // mixed info - The data to associate with the object. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::attach() example // [php] // $o1 = new stdClass; // $o2 = new stdClass; // $s = new SplObjectStorage(); // $s->attach($o1); // similar to $s[$o1] = NULL; // $s->attach($o2, "hello"); // similar to $s[$o2] = "hello"; // // var_dump($s[$o1]); // var_dump($s[$o2]); // // [/php] // The above example will output something similar to: // [result] // NULL // string(5) "hello" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.attach.php // ========== SPLOBJECTSTORAGE_ATTACH - END // SYNTAX: // void SplObjectStorage::attach(object $object, mixed $info = null) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_ATTACH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_CONTAINS // ============================== PUBLIC // ============================== ABOUT // Checks if the storage contains a specific object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::contains() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_contains($splobjectstorage, $object) { $return_splobjectstorage_contains = false; // ========== SPLOBJECTSTORAGE_CONTAINS - BEGIN // ===== ABOUT // Checks if the storage contains a specific object // ===== DESCRIPTION // Checks if the storage contains the object provided. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::contains(object $object): bool // ===== CODE $return_splobjectstorage_contains = $splobjectstorage->contains( $object // object object - The object to look for. ); // Return Values // Returns true if the object is in the storage, false otherwise. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::contains() example // [php] // $o1 = new stdClass; // $o2 = new stdClass; // // $s = new SplObjectStorage(); // // $s[$o1] = "hello"; // var_dump($s->contains($o1)); // var_dump($s->contains($o2)); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.contains.php // ========== SPLOBJECTSTORAGE_CONTAINS - END // SYNTAX: // bool SplObjectStorage::contains(object $object) return $return_splobjectstorage_contains; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_CONTAINS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_COUNT // ============================== PUBLIC // ============================== ABOUT // Returns the number of objects in the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::count() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // COUNT_NORMAL - SplObjectStorage::count() // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_count($splobjectstorage, $mode = COUNT_NORMAL) { $return_splobjectstorage_count = 0; // ========== SPLOBJECTSTORAGE_COUNT - BEGIN // ===== ABOUT // Returns the number of objects in the storage // ===== DESCRIPTION // Counts the number of objects in the storage. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::count(int $mode = COUNT_NORMAL): int // ===== CODE $return_splobjectstorage_count = $splobjectstorage->count( $mode // int mode - If the optional mode parameter is set to COUNT_RECURSIVE (or 1), SplObjectStorage::count() will recursively count the storage. ); // Return Values // The number of objects in the storage. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::count() example // [php] // $s = new SplObjectStorage(); // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1); // $s->attach($o2); // $s->attach($o1); // var_dump($s->count()); // var_dump(count($s)); // [/php] // The above example will output something similar to: // [result] // int(2) // int(2) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.count.php // ========== SPLOBJECTSTORAGE_COUNT - END // SYNTAX: // int SplObjectStorage::count(int $mode = COUNT_NORMAL) return $return_splobjectstorage_count; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_CURRENT // ============================== PUBLIC // ============================== ABOUT // Returns the current storage entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_current($splobjectstorage) { $return_splobjectstorage_current = null; // ========== SPLOBJECTSTORAGE_CURRENT - BEGIN // ===== ABOUT // Returns the current storage entry // ===== DESCRIPTION // Returns the current storage entry. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::current(): object // ===== CODE $return_splobjectstorage_current = $splobjectstorage->current( // This function has no parameters. ); // Return Values // The object at the current iterator position. // // Changelog // Version - Description // 8.1.0 - SplObjectStorage::current() now throws an Error exception if the current position is invalid. Previously, false was returned instead. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::current() example // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // $index = $s->key(); // $object = $s->current(); // similar to current($s) // $data = $s->getInfo(); // // var_dump($object); // var_dump($data); // $s->next(); // } // [/php] // The above example will output something similar to: // [result] // object(stdClass)#2 (0) { // } // string(2) "d1" // object(stdClass)#3 (0) { // } // string(2) "d2" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.current.php // ========== SPLOBJECTSTORAGE_CURRENT - END // SYNTAX: // object SplObjectStorage::current() return $return_splobjectstorage_current; // object } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_DETACH // ============================== PUBLIC // ============================== ABOUT // Removes an object from the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::detach() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_detach($splobjectstorage, $object) { // ========== SPLOBJECTSTORAGE_DETACH - BEGIN // ===== ABOUT // Removes an object from the storage // ===== DESCRIPTION // Removes the object from the storage. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::detach(object $object): void // ===== CODE $splobjectstorage->detach( $object // object object - The object to remove. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::detach() example // [php] // $o = new stdClass; // $s = new SplObjectStorage(); // $s->attach($o); // var_dump(count($s)); // $s->detach($o); // var_dump(count($s)); // [/php] // The above example will output something similar to: // [result] // int(1) // int(0) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.detach.php // ========== SPLOBJECTSTORAGE_DETACH - END // SYNTAX: // void SplObjectStorage::detach(object $object) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_DETACH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_GETHASH // ============================== PUBLIC // ============================== ABOUT // Calculate a unique identifier for the contained objects. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::getHash() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_gethash($splobjectstorage, $object) { $return_splobjectstorage_gethash = null; // ========== SPLOBJECTSTORAGE_GETHASH - BEGIN // ===== ABOUT // Calculate a unique identifier for the contained objects // ===== DESCRIPTION // This method calculates an identifier for the objects added to an SplObjectStorage object. // The implementation in SplObjectStorage returns the same value as spl_object_hash(). // The storage object will never contain more than one object with the same identifier. As such, it can be used to implement a set (a collection of unique values) where the quality of an object being unique is determined by the value returned by this function being unique. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::getHash(object $object): string // ===== CODE $return_splobjectstorage_gethash = $splobjectstorage->getHash( $object // object object - The object whose identifier is to be calculated. ); // Return Values // A string with the calculated identifier. // // Errors/Exceptions // A RuntimeException is thrown when the returned value is not a string. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::getHash() example // [php] // class OneSpecimenPerClassStorage extends SplObjectStorage { // public function getHash($o) { // return get_class($o); // } // } // class A {} // // $s = new OneSpecimenPerClassStorage; // $o1 = new stdClass; // $o2 = new stdClass; // $o3 = new A; // // $s[$o1] = 1; // //$o2 is considered equal to $o1 so the value is replaced // $s[$o2] = 2; // $s[$o3] = 3; // // //these are considered equal to the objects before // //so they can be used to access the values stored under them // $p1 = new stdClass; // $p2 = new A; // echo $s[$p1], "\n"; // echo $s[$p2], "\n"; // [/php] // The above example will output something similar to: // [result] // 2 // 3 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.gethash.php // ========== SPLOBJECTSTORAGE_GETHASH - END // SYNTAX: // string SplObjectStorage::getHash(object $object) return $return_splobjectstorage_gethash; // string } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_GETHASH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_GETINFO // ============================== PUBLIC // ============================== ABOUT // Returns the data associated with the current iterator entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::getInfo() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_getinfo($splobjectstorage) { $return_splobjectstorage_getinfo = null; // ========== SPLOBJECTSTORAGE_GETINFO - BEGIN // ===== ABOUT // Returns the data associated with the current iterator entry // ===== DESCRIPTION // Returns the data, or info, associated with the object pointed by the current iterator position. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::getInfo(): mixed // ===== CODE $return_splobjectstorage_getinfo = $splobjectstorage->getInfo( // This function has no parameters. ); // Return Values // The data associated with the current iterator position. // // [examples] // Examples // Example #1 SplObjectStorage::getInfo() example // [example] // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // $index = $s->key(); // $object = $s->current(); // similar to current($s) // $data = $s->getInfo(); // // var_dump($object); // var_dump($data); // $s->next(); // } // [/php] // The above example will output something similar to: // [result] // object(stdClass)#2 (0) { // } // string(2) "d1" // object(stdClass)#3 (0) { // } // string(2) "d2" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.getinfo.php // ========== SPLOBJECTSTORAGE_GETINFO - END // SYNTAX: // mixed SplObjectStorage::getInfo() return $return_splobjectstorage_getinfo; // mixed } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_GETINFO // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_KEY // ============================== PUBLIC // ============================== ABOUT // Returns the index at which the iterator currently is. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_key($splobjectstorage) { $return_splobjectstorage_key = 0; // ========== SPLOBJECTSTORAGE_KEY - BEGIN // ===== ABOUT // Returns the index at which the iterator currently is // ===== DESCRIPTION // Returns the index at which the iterator currently is. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::key(): int // ===== CODE $return_splobjectstorage_key = $splobjectstorage->key( // This function has no parameters. ); // Return Values // The index corresponding to the position of the iterator. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::key() example // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // $index = $s->key(); // $object = $s->current(); // similar to current($s) // // var_dump($index); // var_dump($object); // $s->next(); // } // [/php] // The above example will output something similar to: // [result] // int(0) // object(stdClass)#2 (0) { // } // int(1) // object(stdClass)#3 (0) { // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.key.php // ========== SPLOBJECTSTORAGE_KEY - END // SYNTAX: // int SplObjectStorage::key() return $return_splobjectstorage_key; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to the next entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_next($splobjectstorage) { // ========== SPLOBJECTSTORAGE_NEXT - BEGIN // ===== ABOUT // Move to the next entry // ===== DESCRIPTION // Moves the iterator to the next object in the storage. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::next(): void // ===== CODE $splobjectstorage->next( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::next() example // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // $index = $s->key(); // $object = $s->current(); // similar to current($s) // // var_dump($index); // var_dump($object); // $s->next(); // } // [/php] // The above example will output something similar to: // [result] // int(0) // object(stdClass)#2 (0) { // } // int(1) // object(stdClass)#3 (0) { // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.next.php // ========== SPLOBJECTSTORAGE_NEXT - END // SYNTAX: // void SplObjectStorage::next() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETEXISTS // ============================== PUBLIC // ============================== ABOUT // Checks whether an object exists in the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::offsetExists() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_offsetexists($splobjectstorage, $object) { $return_splobjectstorage_offsetexists = false; // ========== SPLOBJECTSTORAGE_OFFSETEXISTS - BEGIN // ===== ABOUT // Checks whether an object exists in the storage // ===== DESCRIPTION // Checks whether an object exists in the storage. // Note: SplObjectStorage::offsetExists() is an alias of SplObjectStorage::contains(). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::offsetExists(object $object): bool // ===== CODE $return_splobjectstorage_offsetexists = $splobjectstorage->offsetExists( $object // object object - The object to look for. ); // Return Values // Returns true if the object exists in the storage, and false otherwise. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::offsetExists() example // [php] // $s = new SplObjectStorage; // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1); // // var_dump($s->offsetExists($o1)); // Similar to isset($s[$o1]) // var_dump($s->offsetExists($o2)); // Similar to isset($s[$o2]) // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.offsetexists.php // ========== SPLOBJECTSTORAGE_OFFSETEXISTS - END // SYNTAX: // bool SplObjectStorage::offsetExists(object $object) return $return_splobjectstorage_offsetexists; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETEXISTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETSET // ============================== PUBLIC // ============================== ABOUT // Associates data to an object in the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::offsetSet() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_offsetset($splobjectstorage, $object, $info = null) { // ========== SPLOBJECTSTORAGE_OFFSETSET - BEGIN // ===== ABOUT // Associates data to an object in the storage // ===== DESCRIPTION // Associate data to an object in the storage. // Note: SplObjectStorage::offsetSet() is an alias of SplObjectStorage::attach(). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::offsetSet(object $object, mixed $info = null): void // ===== CODE $splobjectstorage->offsetSet( $object, // object object - The object to associate data with. $info // mixed info - The data to associate with the object. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::offsetSet() example // [php] // $s = new SplObjectStorage; // // $o1 = new stdClass; // // $s->offsetSet($o1, "hello"); // Similar to $s[$o1] = "hello"; // // var_dump($s[$o1]); // [/php] // The above example will output something similar to: // [result] // string(5) "hello" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.offsetset.php // ========== SPLOBJECTSTORAGE_OFFSETSET - END // SYNTAX: // void SplObjectStorage::offsetSet(object $object, mixed $info = null) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETUNSET // ============================== PUBLIC // ============================== ABOUT // Removes an object from the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::offsetUnset() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_offsetunset($splobjectstorage, $object) { // ========== SPLOBJECTSTORAGE_OFFSETUNSET - BEGIN // ===== ABOUT // Removes an object from the storage // ===== DESCRIPTION // Removes an object from the storage. // Note: SplObjectStorage::offsetUnset() is an alias of SplObjectStorage::detach(). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::offsetUnset(object $object): void // ===== CODE $splobjectstorage->offsetUnset( $object // object object - The object to remove. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::offsetUnset() example // [php] // $o = new stdClass; // $s = new SplObjectStorage(); // $s->attach($o); // var_dump(count($s)); // $s->offsetUnset($o); // Similar to unset($s[$o]) // var_dump(count($s)); // [/php] // The above example will output something similar to: // [result] // int(1) // int(0) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.offsetunset.php // ========== SPLOBJECTSTORAGE_OFFSETUNSET - END // SYNTAX: // void SplObjectStorage::offsetUnset(object $object) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_OFFSETUNSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REMOVEALL // ============================== PUBLIC // ============================== ABOUT // Removes objects contained in another storage from the current storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::removeAll() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_removeall($splobjectstorage, $storage) { $return_splobjectstorage_removeall = 0; // ========== SPLOBJECTSTORAGE_REMOVEALL - BEGIN // ===== ABOUT // Removes objects contained in another storage from the current storage // ===== DESCRIPTION // Removes objects contained in another storage from the current storage. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::removeAll(SplObjectStorage $storage): int // ===== CODE $return_splobjectstorage_removeall = $splobjectstorage->removeAll( $storage // SplObjectStorage storage - The storage containing the elements to remove. ); // Return Values // Returns the number of remaining objects. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::removeAll() example // [php] // $o1 = new stdClass; // $o2 = new stdClass; // $a = new SplObjectStorage(); // $a[$o1] = "foo"; // // $b = new SplObjectStorage(); // $b[$o1] = "bar"; // $b[$o2] = "gee"; // // var_dump(count($b)); // $b->removeAll($a); // var_dump(count($b)); // [/php] // The above example will output something similar to: // [result] // int(2) // int(1) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.removeall.php // ========== SPLOBJECTSTORAGE_REMOVEALL - END // SYNTAX: // int SplObjectStorage::removeAll(SplObjectStorage $storage) return $return_splobjectstorage_removeall; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REMOVEALL // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REMOVEALLEXCEPT // ============================== PUBLIC // ============================== ABOUT // Removes all objects except for those contained in another storage from the current storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::removeAllExcept() - PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_removeallexcept($splobjectstorage, $storage) { $return_splobjectstorage_removeallexcept = 0; // ========== SPLOBJECTSTORAGE_REMOVEALLEXCEPT - BEGIN // ===== ABOUT // Removes all objects except for those contained in another storage from the current storage // ===== DESCRIPTION // Removes all objects except for those contained in another storage from the current storage. // ===== SUPPORTED // PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::removeAllExcept(SplObjectStorage $storage): int // ===== CODE $return_splobjectstorage_removeallexcept = $splobjectstorage->removeAllExcept( $storage // SplObjectStorage storage - The storage containing the elements to retain in the current storage. ); // Return Values // Returns the number of remaining objects. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::removeAllExcept() example // [php] // $a = (object) 'a'; // $b = (object) 'b'; // $c = (object) 'c'; // // $foo = new SplObjectStorage; // $foo->attach($a); // $foo->attach($b); // // $bar = new SplObjectStorage; // $bar->attach($b); // $bar->attach($c); // // $foo->removeAllExcept($bar); // var_dump($foo->contains($a)); // var_dump($foo->contains($b)); // [/php] // The above example will output something similar to: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.removeallexcept.php // ========== SPLOBJECTSTORAGE_REMOVEALLEXCEPT - END // SYNTAX: // int SplObjectStorage::removeAllExcept(SplObjectStorage $storage) return $return_splobjectstorage_removeallexcept; // int } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REMOVEALLEXCEPT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the iterator to the first storage element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_rewind($splobjectstorage) { // ========== SPLOBJECTSTORAGE_REWIND - BEGIN // ===== ABOUT // Rewind the iterator to the first storage element // ===== DESCRIPTION // Rewind the iterator to the first storage element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::rewind(): void // ===== CODE $splobjectstorage->rewind( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::rewind() example // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // $index = $s->key(); // $object = $s->current(); // similar to current($s) // $data = $s->getInfo(); // // var_dump($object); // var_dump($data); // $s->next(); // } // [/php] // The above example will output something similar to: // [result] // int(1) // int(0) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.rewind.php // ========== SPLOBJECTSTORAGE_REWIND - END // SYNTAX: // void SplObjectStorage::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_SERIALIZE // ============================== PUBLIC // ============================== ABOUT // Serializes the storage. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::serialize() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_serialize($splobjectstorage) { $return_splobjectstorage_serialize = null; // ========== SPLOBJECTSTORAGE_SERIALIZE - BEGIN // ===== ABOUT // Serializes the storage // ===== DESCRIPTION // Returns a string representation of the storage. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::serialize(): string // ===== CODE $return_splobjectstorage_serialize = $splobjectstorage->serialize( // This function has no parameters. ); // Return Values // A string representing the storage. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::serialize() example // [php] // $s = new SplObjectStorage; // $o = new stdClass; // $s[$o] = "data"; // // echo $s->serialize()."\n"; // [/php] // The above example will output something similar to: // [result] // x:i:1;O:8:"stdClass":0:{},s:4:"data";;m:a:0:{} // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.serialize.php // ========== SPLOBJECTSTORAGE_SERIALIZE - END // SYNTAX: // string SplObjectStorage::serialize() return $return_splobjectstorage_serialize; // string } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_SERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_SETINFO // ============================== PUBLIC // ============================== ABOUT // Sets the data associated with the current iterator entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::setInfo() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_setinfo($splobjectstorage, $info) { $return_splobjectstorage_setinfo = false; // ========== SPLOBJECTSTORAGE_SETINFO - BEGIN // ===== ABOUT // Sets the data associated with the current iterator entry // ===== DESCRIPTION // Associates data, or info, with the object currently pointed to by the iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::setInfo(mixed $info): void // ===== CODE $return_splobjectstorage_setinfo = $splobjectstorage->setInfo( $info // mixed info - The data to associate with the current iterator entry. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::setInfo() example // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // $s->setInfo("new"); // $s->next(); // } // var_dump($s[$o1]); // var_dump($s[$o2]); // [/php] // The above example will output something similar to: // [result] // string(3) "new" // string(3) "new" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.setinfo.php // ========== SPLOBJECTSTORAGE_SETINFO - END // SYNTAX: // void SplObjectStorage::setInfo(mixed $info) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_SETINFO // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_UNSERIALIZE // ============================== PUBLIC // ============================== ABOUT // Unserializes a storage from its string representation. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::unserialize() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_unserialize($splobjectstorage, $data) { // ========== SPLOBJECTSTORAGE_UNSERIALIZE - BEGIN // ===== ABOUT // Unserializes a storage from its string representation // ===== DESCRIPTION // Unserializes storage entries and attach them to the current storage. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::unserialize(string $data): void // ===== CODE $splobjectstorage->unserialize( $data // string data - The serialized representation of a storage. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::unserialize() example // [php] // $s1 = new SplObjectStorage; // $s2 = new SplObjectStorage; // $o = new stdClass; // $s1[$o] = "data"; // // $s2->unserialize($s1->serialize()); // // var_dump(count($s2)); // [/php] // The above example will output something similar to: // [result] // int(1) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.unserialize.php // ========== SPLOBJECTSTORAGE_UNSERIALIZE - END // SYNTAX: // void SplObjectStorage::unserialize(string $data) // Return: void } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_UNSERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_VALID // ============================== PUBLIC // ============================== ABOUT // Returns if the current iterator entry is valid. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplObjectStorage::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_datastructures_splobjectstorage_valid($splobjectstorage) { $return_splobjectstorage_valid = false; // ========== SPLOBJECTSTORAGE_VALID - BEGIN // ===== ABOUT // Returns if the current iterator entry is valid // ===== DESCRIPTION // Returns if the current iterator entry is valid. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplObjectStorage::valid(): bool // ===== CODE $return_splobjectstorage_valid = $splobjectstorage->valid( // This function has no parameters. ); // Return Values // Returns true if the iterator entry is valid, false otherwise. // // [examples] // Examples // [example] // Example #1 SplObjectStorage::valid() example // [php] // $s = new SplObjectStorage(); // // $o1 = new stdClass; // $o2 = new stdClass; // // $s->attach($o1, "d1"); // $s->attach($o2, "d2"); // // $s->rewind(); // while($s->valid()) { // echo $s->key()."\n"; // $s->next(); // } // [/php] // The above example will output something similar to: // [result] // 0 // 1 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splobjectstorage.valid.php // ========== SPLOBJECTSTORAGE_VALID - END // SYNTAX: // bool SplObjectStorage::valid() return $return_splobjectstorage_valid; // bool } // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE_VALID // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES_SPLOBJECTSTORAGE // ============================== // ============================== END // PHP_BASIC_SPL_DATASTRUCTURES // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS // ============================== PUBLIC // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_APPEND - void php_basic_spl_iterators_appenditerator_append(AppendIterator $appenditerator, Iterator $Iterator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_CONSTRUCT - AppendIterator php_basic_spl_iterators_appenditerator_construct() // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_CURRENT - mixed php_basic_spl_iterators_appenditerator_current(AppendIterator $appenditerator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_GETARRAYITERATOR - ArrayIterator php_basic_spl_iterators_appenditerator_getarrayiterator(AppendIterator $appenditerator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_GETITERATORINDEX - int php_basic_spl_iterators_appenditerator_getiteratorindex(AppendIterator $appenditerator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_KEY - scalar php_basic_spl_iterators_appenditerator_key(AppendIterator $appenditerator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_NEXT - void php_basic_spl_iterators_appenditerator_next(AppendIterator $appenditerator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_REWIND - void php_basic_spl_iterators_appenditerator_rewind(AppendIterator $appenditerator) // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_VALID - bool php_basic_spl_iterators_appenditerator_valid(AppendIterator $appenditerator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (9) // AppendIterator::append() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator::getArrayIterator() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // AppendIterator::getIteratorIndex() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // AppendIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // AppendIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (8) // void // AppendIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // mixed // ArrayIterator - PHP_5, PHP_7, PHP_8 // int // scalar // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_APPEND // ============================== PUBLIC // ============================== ABOUT // Appends an iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::append() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_append($appenditerator, $Iterator) { // ========== APPENDITERATOR_APPEND - BEGIN // ===== ABOUT // Appends an iterator // ===== DESCRIPTION // Appends an iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::append(Iterator $iterator): void // ===== CODE $appenditerator->append( $Iterator // Iterator iterator - The iterator to append. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 AppendIterator::append() example // [php] // $array_a = new ArrayIterator(array('a', 'b', 'c')); // $array_b = new ArrayIterator(array('d', 'e', 'f')); // // $iterator = new AppendIterator; // $iterator->append($array_a); // $iterator->append($array_b); // // foreach ($iterator as $current) { // echo $current; // } // [/php] // The above example will output: // [result] // abcdef // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.append.php // ========== APPENDITERATOR_APPEND - END // SYNTAX: // void AppendIterator::append(Iterator $iterator) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_APPEND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs an AppendIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_construct() { $return_appenditerator_construct = null; // ========== APPENDITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs an AppendIterator // ===== DESCRIPTION // Constructs an AppendIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::__construct() // ===== CODE $return_appenditerator_construct = new AppendIterator( // This function has no parameters. ); // Return // AppendIterator // // [examples] // Examples // [example] // Example #1 Iterating AppendIterator with foreach // [php] // $pizzas = new ArrayIterator(array('Margarita', 'Siciliana', 'Hawaii')); // $toppings = new ArrayIterator(array('Cheese', 'Anchovies', 'Olives', 'Pineapple', 'Ham')); // // $appendIterator = new AppendIterator; // $appendIterator->append($pizzas); // $appendIterator->append($toppings); // // foreach ($appendIterator as $key => $item) { // echo $key . ' => ' . $item . PHP_EOL; // } // [/php] // The above example will output: // [result] // 0 => Margarita // 1 => Siciliana // 2 => Hawaii // 0 => Cheese // 1 => Anchovies // 2 => Olives // 3 => Pineapple // 4 => Ham // [/result] // [/example] // [example] // Example #2 Iterating AppendIterator with the AppendIterator API // [php] // $pizzas = new ArrayIterator(array('Margarita', 'Siciliana', 'Hawaii')); // $toppings = new ArrayIterator(array('Cheese', 'Anchovies', 'Olives', 'Pineapple', 'Ham')); // // $appendIterator = new AppendIterator; // $appendIterator->append($pizzas); // $appendIterator->append($toppings); // // while ($appendIterator->valid()) { // printf( // '%s => %s => %s%s', // $appendIterator->getIteratorIndex(), // $appendIterator->key(), // $appendIterator->current(), // PHP_EOL // ); // $appendIterator->next(); // } // [/php] // The above example will output: // [result] // 0 => 0 => Margarita // 0 => 1 => Siciliana // 0 => 2 => Hawaii // 1 => 0 => Cheese // 1 => 1 => Anchovies // 1 => 2 => Olives // 1 => 3 => Pineapple // 1 => 4 => Ham // [/result] // [/example] // [/examples] // // Notes // Caution: When using iterator_to_array() to copy the values of the AppendIterator into an array, you have to set the optional use_key argument to false. When use_key is not false any keys reoccurring in inner iterators will get overwritten in the returned array. There is no way to preserve the original keys. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.construct.php // ========== APPENDITERATOR_CONSTRUCT - END // SYNTAX: // AppendIterator AppendIterator::__construct() return $return_appenditerator_construct; // AppendIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Gets the current value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_current($appenditerator) { $return_appenditerator_current = null; // ========== APPENDITERATOR_CURRENT - BEGIN // ===== ABOUT // Gets the current value // ===== DESCRIPTION // Gets the current value. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::current(): mixed // ===== CODE $return_appenditerator_current = $appenditerator->current( // This function has no parameters. ); // Return Values // The current value if it is valid or null otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.current.php // ========== APPENDITERATOR_CURRENT - END // SYNTAX: // mixed AppendIterator::current() return $return_appenditerator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_GETARRAYITERATOR // ============================== PUBLIC // ============================== ABOUT // Gets the ArrayIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::getArrayIterator() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_getarrayiterator($appenditerator) { $return_appenditerator_getarrayiterator = null; // ========== APPENDITERATOR_GETARRAYITERATOR - BEGIN // ===== ABOUT // Gets the ArrayIterator // ===== DESCRIPTION // This method gets the ArrayIterator that is used to store the iterators added with AppendIterator::append(). // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::getArrayIterator(): ArrayIterator // ===== CODE $return_appenditerator_getarrayiterator = $appenditerator->getArrayIterator( // This function has no parameters.s ); // Return Values // Returns an ArrayIterator containing the appended iterators. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.getarrayiterator.php // ========== APPENDITERATOR_GETARRAYITERATOR - END // SYNTAX: // ArrayIterator AppendIterator::getArrayIterator() return $return_appenditerator_getarrayiterator; // ArrayIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_GETARRAYITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_GETITERATORINDEX // ============================== PUBLIC // ============================== ABOUT // Gets an index of iterators. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::getIteratorIndex() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_getiteratorindex($appenditerator) { $return_appenditerator_getiteratorindex = 0; // ========== APPENDITERATOR_GETITERATORINDEX - BEGIN // ===== ABOUT // Gets an index of iterators // ===== DESCRIPTION // Gets the index of the current inner iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::getIteratorIndex(): ?int // ===== CODE $return_appenditerator_getiteratorindex = $appenditerator->getIteratorIndex( // This function has no parameters. ); // Return Values // Returns the zero-based, integer index of the current inner iterator if it exists, or null otherwise. // // [examples] // Examples // [example] // Example #1 AppendIterator.getIteratorIndex() basic example // [php] // $array_a = new ArrayIterator(array('a' => 'aardwolf', 'b' => 'bear', 'c' => 'capybara')); // $array_b = new ArrayIterator(array('apple', 'orange', 'lemon')); // // $iterator = new AppendIterator; // $iterator->append($array_a); // $iterator->append($array_b); // // foreach ($iterator as $key => $current) { // echo $iterator->getIteratorIndex() . ' ' . $key . ' ' . $current . PHP_EOL; // } // [/php] // The above example will output: // [result] // 0 a aardwolf // 0 b bear // 0 c capybara // 1 0 apple // 1 1 orange // 1 2 lemon // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.getiteratorindex.php // ========== APPENDITERATOR_GETITERATORINDEX - END // SYNTAX: // int AppendIterator::getIteratorIndex() return $return_appenditerator_getiteratorindex; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_GETITERATORINDEX // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Gets the current key. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_key($appenditerator) { $return_appenditerator_key = null; // ========== APPENDITERATOR_KEY - BEGIN // ===== ABOUT // Gets the current key // ===== DESCRIPTION // Get the current key. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::key(): scalar // ===== CODE $return_appenditerator_key = $appenditerator->key( // This function has no parameters. ); // Return Values // The current key if it is valid or null otherwise. // // [examples] // Examples // [example] // Example #1 AppendIterator::key() basic example // [php] // $array_a = new ArrayIterator(array('a' => 'aardwolf', 'b' => 'bear', 'c' => 'capybara')); // $array_b = new ArrayIterator(array('apple', 'orange', 'lemon')); // // $iterator = new AppendIterator; // $iterator->append($array_a); // $iterator->append($array_b); // // // Manual iteration // $iterator->rewind(); // while ($iterator->valid()) { // echo $iterator->key() . ' ' . $iterator->current() . PHP_EOL; // $iterator->next(); // } // // echo PHP_EOL; // // // With foreach // foreach ($iterator as $key => $current) { // echo $key . ' ' . $current . PHP_EOL; // } // [/php] // The above example will output: // [result] // a aardwolf // b bear // c capybara // 0 apple // 1 orange // 2 lemon // // a aardwolf // b bear // c capybara // 0 apple // 1 orange // 2 lemon // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.key.php // ========== APPENDITERATOR_KEY - END // SYNTAX: // scalar AppendIterator::key() return $return_appenditerator_key; // scalar } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Moves to the next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_next($appenditerator) { // ========== APPENDITERATOR_NEXT - BEGIN // ===== ABOUT // Moves to the next element // ===== DESCRIPTION // Moves to the next element. If this means to another Iterator then it rewinds that Iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::next(): void // ===== CODE $appenditerator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.next.php // ========== APPENDITERATOR_NEXT - END // SYNTAX: // void AppendIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewinds the Iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_rewind($appenditerator) { // ========== APPENDITERATOR_REWIND - BEGIN // ===== ABOUT // Rewinds the Iterator // ===== DESCRIPTION // Rewind to the first element of the first inner Iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::rewind(): void // ===== CODE $appenditerator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.rewind.php // ========== APPENDITERATOR_REWIND - END // SYNTAX: // void AppendIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Checks validity of the current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // AppendIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_appenditerator_valid($appenditerator) { $return_appenditerator_valid = false; // ========== APPENDITERATOR_VALID - BEGIN // ===== ABOUT // Checks validity of the current element // ===== DESCRIPTION // Checks validity of the current element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public AppendIterator::valid(): bool // ===== CODE $return_appenditerator_valid = $appenditerator->valid( // This function has no parameters. ); // Return Values // Returns true if the current iteration is valid, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/appenditerator.valid.php // ========== APPENDITERATOR_VALID - END // SYNTAX: // bool AppendIterator::valid() return $return_appenditerator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_APPENDITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_APPEND - void php_basic_spl_iterators_arrayiterator_append(ArrayIterator $arrayiterator, mixed $value) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_ASORT - bool php_basic_spl_iterators_arrayiterator_asort(ArrayIterator $arrayiterator, int $flags = SORT_REGULAR) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_CONSTRUCT - ArrayIterator php_basic_spl_iterators_arrayiterator_construct(array|object $array = array(), int $flags = 0) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_COUNT - int php_basic_spl_iterators_arrayiterator_count(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_CURRENT - mixed php_basic_spl_iterators_arrayiterator_current(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_GETARRAYCOPY - array php_basic_spl_iterators_arrayiterator_getarraycopy(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_GETFLAGS - int php_basic_spl_iterators_arrayiterator_getflags(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_KEY - string|int|null php_basic_spl_iterators_arrayiterator_key(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_KSORT - bool php_basic_spl_iterators_arrayiterator_ksort(ArrayIterator $arrayiterator, int $flags = SORT_REGULAR) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NATCASESORT - bool php_basic_spl_iterators_arrayiterator_natcasesort(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NATSORT - bool php_basic_spl_iterators_arrayiterator_natsort(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NEXT - void php_basic_spl_iterators_arrayiterator_next(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETEXISTS - bool php_basic_spl_iterators_arrayiterator_offsetexists(ArrayIterator $arrayiterator, mixed $key) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETGET - mixed php_basic_spl_iterators_arrayiterator_offsetget(ArrayIterator $arrayiterator, mixed $key) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETSET - void php_basic_spl_iterators_arrayiterator_offsetset(ArrayIterator $arrayiterator, mixed $key, mixed $value) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETUNSET - void php_basic_spl_iterators_arrayiterator_offsetunset(ArrayIterator $arrayiterator, mixed $key) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_REWIND - void php_basic_spl_iterators_arrayiterator_rewind(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SEEK - void php_basic_spl_iterators_arrayiterator_seek(ArrayIterator $arrayiterator, int $offset) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SERIALIZE - string php_basic_spl_iterators_arrayiterator_serialize(ArrayIterator $arrayiterator) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SETFLAGS - void php_basic_spl_iterators_arrayiterator_setflags(ArrayIterator $arrayiterator, int $flags) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UASORT - bool php_basic_spl_iterators_arrayiterator_uasort(ArrayIterator $arrayiterator, callable $callback) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UKSORT - bool php_basic_spl_iterators_arrayiterator_uksort(ArrayIterator $arrayiterator, callable $callback) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UNSERIALIZE - void php_basic_spl_iterators_arrayiterator_unserialize(ArrayIterator $arrayiterator, string $data) // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_VALID - bool php_basic_spl_iterators_arrayiterator_valid(ArrayIterator $arrayiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (24) // ArrayIterator::append() - PHP_5, PHP_7, PHP_8 // ArrayIterator::asort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayIterator::__construct() - PHP_5, PHP_7, PHP_8 // ArrayIterator::count() - PHP_5, PHP_7, PHP_8 // ArrayIterator::current() - PHP_5, PHP_7, PHP_8 // ArrayIterator::getArrayCopy() - PHP_5, PHP_7, PHP_8 // ArrayIterator::getFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayIterator::key() - PHP_5, PHP_7, PHP_8 // ArrayIterator::ksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayIterator::natcasesort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayIterator::natsort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayIterator::next() - PHP_5, PHP_7, PHP_8 // ArrayIterator::offsetExists() - PHP_5, PHP_7, PHP_8 // ArrayIterator::offsetGet() - PHP_5, PHP_7, PHP_8 // ArrayIterator::offsetSet() - PHP_5, PHP_7, PHP_8 // ArrayIterator::offsetUnset() - PHP_5, PHP_7, PHP_8 // ArrayIterator::rewind() - PHP_5, PHP_7, PHP_8 // ArrayIterator::seek() - PHP_5, PHP_7, PHP_8 // ArrayIterator::serialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ArrayIterator::setFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayIterator::uasort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayIterator::uksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayIterator::unserialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ArrayIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (10) // void // ArrayIterator - PHP_5, PHP_7, PHP_8 // mixed // bool // int // array // object // string // null // callable // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_APPEND // ============================== PUBLIC // ============================== ABOUT // Append an element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::append() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_append($arrayiterator, $value) { // ========== ARRAYITERATOR_APPEND - BEGIN // ===== ABOUT // Append an element // ===== DESCRIPTION // Appends value as the last element. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::append(mixed $value): void // ===== CODE $arrayiterator->append( $value // mixed value - The value to append. ); // Return Values // No value is returned. // // Notes // Note: This method cannot be called when the ArrayIterator refers to an object. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/arrayiterator.append.php // ========== ARRAYITERATOR_APPEND - END // SYNTAX: // void ArrayIterator::append(mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_APPEND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_ASORT // ============================== PUBLIC // ============================== ABOUT // Sort entries by values. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::asort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // SORT_REGULAR - ArrayIterator::asort() // ============================== CODE function php_basic_spl_iterators_arrayiterator_asort($arrayiterator, $flags = SORT_REGULAR) { $return_arrayiterator_asort = false; // ========== ARRAYITERATOR_ASORT - BEGIN // ===== ABOUT // Sort entries by values // ===== DESCRIPTION // Sorts entries by their values. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::asort(int $flags = SORT_REGULAR): true // ===== CODE $return_arrayiterator_asort = $arrayiterator->asort( $flags // int flags - The optional second parameter flags may be used to modify the sorting behavior using these values: // // Sorting type flags: // * SORT_REGULAR - compare items normally; the details are described in the comparison operators section // * SORT_NUMERIC - compare items numerically // * SORT_STRING - compare items as strings // * SORT_LOCALE_STRING - compare items as strings, based on the current locale. It uses the locale, which can be changed using setlocale() // * SORT_NATURAL - compare items as strings using "natural ordering" like natsort() // * SORT_FLAG_CASE - can be combined (bitwise OR) with SORT_STRING or SORT_NATURAL to sort strings case-insensitively ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/arrayiterator.asort.php // ========== ARRAYITERATOR_ASORT - END // SYNTAX: // bool ArrayIterator::asort(int $flags = SORT_REGULAR) return $return_arrayiterator_asort; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_ASORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct an ArrayIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_construct($array = array(), $flags = 0) { $return_arrayiterator_construct = null; // ========== ARRAYITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct an ArrayIterator // ===== DESCRIPTION // Constructs an ArrayIterator object. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::__construct(array|object $array = [], int $flags = 0) // ===== CODE $return_arrayiterator_construct = new ArrayIterator( $array, // array|object array - The array or object to be iterated on. $flags // int flags - Flags to control the behaviour of the ArrayIterator object. See ArrayIterator::setFlags(). ); // Return // ArrayIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-18) // URL: https://www.php.net/manual/en/arrayiterator.construct.php // ========== ARRAYITERATOR_CONSTRUCT - END // SYNTAX: // ArrayIterator ArrayIterator::__construct(array|object $array = array(), int $flags = 0) return $return_arrayiterator_construct; // ArrayIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_COUNT // ============================== PUBLIC // ============================== ABOUT // Count elements. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::count() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_count($arrayiterator) { $return_arrayiterator_count = 0; // ========== ARRAYITERATOR_COUNT - BEGIN // ===== ABOUT // Count elements // ===== DESCRIPTION // Gets the number of elements in the array, or the number of public properties in the object. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::count(): int // ===== CODE $return_arrayiterator_count = $arrayiterator->count( // This function has no parameters. ); // Return Values // The number of elements or public properties in the associated array or object, respectively. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.count.php // ========== ARRAYITERATOR_COUNT - END // SYNTAX: // int ArrayIterator::count() return $return_arrayiterator_count; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Return current array entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::current() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_current($arrayiterator) { $return_arrayiterator_current = null; // ========== ARRAYITERATOR_CURRENT - BEGIN // ===== ABOUT // Return current array entry // ===== DESCRIPTION // Get the current array entry. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::current(): mixed // ===== CODE $return_arrayiterator_current = $arrayiterator->current( // This function has no parameters. ); // Return Values // The current array entry. // // [examples] // Examples // [example] // Example #1 ArrayIterator::current() example // [php] // $array = array('1' => 'one', // '2' => 'two', // '3' => 'three'); // // $arrayobject = new ArrayObject($array); // // for($iterator = $arrayobject->getIterator(); // $iterator->valid(); // $iterator->next()) { // // echo $iterator->key() . ' => ' . $iterator->current() . "\n"; // } // [/php] // The above example will output: // [result] // 1 => one // 2 => two // 3 => three // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.current.php // ========== ARRAYITERATOR_CURRENT - END // SYNTAX: // mixed ArrayIterator::current() return $return_arrayiterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_GETARRAYCOPY // ============================== PUBLIC // ============================== ABOUT // Get array copy. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::getArrayCopy() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_getarraycopy($arrayiterator) { $return_arrayiterator_getarraycopy = null; // ========== ARRAYITERATOR_GETARRAYCOPY - BEGIN // ===== ABOUT // Get array copy // ===== DESCRIPTION // Get a copy of an array. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::getArrayCopy(): array // ===== CODE $return_arrayiterator_getarraycopy = $arrayiterator->getArrayCopy( // This function has no parameters. ); // Return Values // A copy of the array, or array of public properties if ArrayIterator refers to an object. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.getarraycopy.php // ========== ARRAYITERATOR_GETARRAYCOPY - END // SYNTAX: // array ArrayIterator::getArrayCopy() return $return_arrayiterator_getarraycopy; // array } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_GETARRAYCOPY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Get behavior flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::getFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_getflags($arrayiterator) { $return_arrayiterator_getflags = 0; // ========== ARRAYITERATOR_GETFLAGS - BEGIN // ===== ABOUT // Get behavior flags // ===== DESCRIPTION // Gets the behavior flags of the ArrayIterator. See the ArrayIterator::setFlags method for a list of the available flags. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::getFlags(): int // ===== CODE $return_arrayiterator_getflags = $arrayiterator->getFlags( // This function has no parameters. ); // Return Values // Returns the behavior flags of the ArrayIterator. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.getflags.php // ========== ARRAYITERATOR_GETFLAGS - END // SYNTAX: // int ArrayIterator::getFlags() return $return_arrayiterator_getflags; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Return current array key. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::key() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_key($arrayiterator) { $return_arrayiterator_key = null; // ========== ARRAYITERATOR_KEY - BEGIN // ===== ABOUT // Return current array key // ===== DESCRIPTION // This function returns the current array key // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::key(): string|int|null // ===== CODE $return_arrayiterator_key = $arrayiterator->key( // This function has no parameters. ); // Return Values // The current array key. // // [examples] // Examples // [example] // Example #1 ArrayIterator::key() example // [php] // $array = array('key' => 'value'); // // $arrayobject = new ArrayObject($array); // $iterator = $arrayobject->getIterator(); // // echo $iterator->key(); //key // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.key.php // ========== ARRAYITERATOR_KEY - END // SYNTAX: // string|int|null ArrayIterator::key() return $return_arrayiterator_key; // string|int|null } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_KSORT // ============================== PUBLIC // ============================== ABOUT // Sort entries by keys. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::ksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // SORT_REGULAR - ArrayIterator::ksort() // ============================== CODE function php_basic_spl_iterators_arrayiterator_ksort($arrayiterator, $flags = SORT_REGULAR) { $return_arrayiterator_ksort = false; // ========== ARRAYITERATOR_KSORT - BEGIN // ===== ABOUT // Sort entries by keys // ===== DESCRIPTION // Sorts entries by their keys. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::ksort(int $flags = SORT_REGULAR): true // ===== CODE $return_arrayiterator_ksort = $arrayiterator->ksort( $flags // int flags - The optional second parameter flags may be used to modify the sorting behavior using these values: // // Sorting type flags: // * SORT_REGULAR - compare items normally; the details are described in the comparison operators section // * SORT_NUMERIC - compare items numerically // * SORT_STRING - compare items as strings // * SORT_LOCALE_STRING - compare items as strings, based on the current locale. It uses the locale, which can be changed using setlocale() // * SORT_NATURAL - compare items as strings using "natural ordering" like natsort() // * SORT_FLAG_CASE - can be combined (bitwise OR) with SORT_STRING or SORT_NATURAL to sort strings case-insensitively ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.ksort.php // ========== ARRAYITERATOR_KSORT - END // SYNTAX: // bool ArrayIterator::ksort(int $flags = SORT_REGULAR) return $return_arrayiterator_ksort; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_KSORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NATCASESORT // ============================== PUBLIC // ============================== ABOUT // Sort entries naturally, case insensitive. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::natcasesort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_natcasesort($arrayiterator) { $return_arrayiterator_natcasesort = false; // ========== ARRAYITERATOR_NATCASESORT - BEGIN // ===== ABOUT // Sort entries naturally, case insensitive // ===== DESCRIPTION // Sort the entries by values using a case insensitive "natural order" algorithm. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::natcasesort(): true // ===== CODE $return_arrayiterator_natcasesort = $arrayiterator->natcasesort( // This function has no parameters. ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.natcasesort.php // ========== ARRAYITERATOR_NATCASESORT - END // SYNTAX: // bool ArrayIterator::natcasesort() return $return_arrayiterator_natcasesort; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NATCASESORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NATSORT // ============================== PUBLIC // ============================== ABOUT // Sort entries naturally. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::natsort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_natsort($arrayiterator) { $return_arrayiterator_natsort = false; // ========== ARRAYITERATOR_NATSORT - BEGIN // ===== ABOUT // Sort entries naturally // ===== DESCRIPTION // Sort the entries by values using a "natural order" algorithm. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::natsort(): true // ===== CODE $return_arrayiterator_natsort = $arrayiterator->natsort( // This function has no parameters. ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.natsort.php // ========== ARRAYITERATOR_NATSORT - END // SYNTAX: // bool ArrayIterator::natsort() return $return_arrayiterator_natsort; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NATSORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to next entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::next() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_next($arrayiterator) { // ========== ARRAYITERATOR_NEXT - BEGIN // ===== ABOUT // Move to next entry // ===== DESCRIPTION // The iterator to the next entry. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::next(): void // ===== CODE $arrayiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayIterator::next() example // [php] // $arrayobject = new ArrayObject(); // // $arrayobject[] = 'zero'; // $arrayobject[] = 'one'; // // $iterator = $arrayobject->getIterator(); // // while($iterator->valid()) { // echo $iterator->key() . ' => ' . $iterator->current() . "\n"; // // $iterator->next(); // } // [/php] // The above example will output: // [result] // 0 => zero // 1 => one // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.next.php // ========== ARRAYITERATOR_NEXT - END // SYNTAX: // void ArrayIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETEXISTS // ============================== PUBLIC // ============================== ABOUT // Check if offset exists. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::offsetExists() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_offsetexists($arrayiterator, $key) { $return_arrayiterator_offsetexists = false; // ========== ARRAYITERATOR_OFFSETEXISTS - BEGIN // ===== ABOUT // Check if offset exists // ===== DESCRIPTION // Checks if the offset exists. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::offsetExists(mixed $key): bool // ===== CODE $return_arrayiterator_offsetexists = $arrayiterator->offsetExists( $key // mixed key - The offset being checked. ); // Return Values // true if the offset exists, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.offsetexists.php // ========== ARRAYITERATOR_OFFSETEXISTS - END // SYNTAX: // bool ArrayIterator::offsetExists(mixed $key) return $return_arrayiterator_offsetexists; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETEXISTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETGET // ============================== PUBLIC // ============================== ABOUT // Get value for an offset. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::offsetGet() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_offsetget($arrayiterator, $key) { $return_arrayiterator_offsetget = null; // ========== ARRAYITERATOR_OFFSETGET - BEGIN // ===== ABOUT // Get value for an offset // ===== DESCRIPTION // Gets the value from the provided offset. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::offsetGet(mixed $key): mixed // ===== CODE $return_arrayiterator_offsetget = $arrayiterator->offsetGet( $key // mixed key - The offset to get the value from. ); // Return Values // The value at offset key. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.offsetget.php // ========== ARRAYITERATOR_OFFSETGET - END // SYNTAX: // mixed ArrayIterator::offsetGet(mixed $key) return $return_arrayiterator_offsetget; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETGET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETSET // ============================== PUBLIC // ============================== ABOUT // Set value for an offset. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::offsetSet() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_offsetset($arrayiterator, $key, $value) { // ========== ARRAYITERATOR_OFFSETSET - BEGIN // ===== ABOUT // Set value for an offset // ===== DESCRIPTION // Sets a value for a given offset. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::offsetSet(mixed $key, mixed $value): void // ===== CODE $arrayiterator->offsetSet( $key, // mixed key - The index to set for. $value // mixed value - The new value to store at the index. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-19) // URL: https://www.php.net/manual/en/arrayiterator.offsetset.php // ========== ARRAYITERATOR_OFFSETSET - END // SYNTAX: // void ArrayIterator::offsetSet(mixed $key, mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETUNSET // ============================== PUBLIC // ============================== ABOUT // Unset value for an offset. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::offsetUnset() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_offsetunset($arrayiterator, $key) { // ========== ARRAYITERATOR_OFFSETUNSET - BEGIN // ===== ABOUT // Unset value for an offset // ===== DESCRIPTION // Unsets a value for an offset. // If iteration is in progress, and ArrayIterator::offsetUnset() is used to unset the current index of iteration, the iteration position will be advanced to the next index. Since the iteration position is also advanced at the end of a foreach loop body, use of ArrayIterator::offsetUnset() inside a foreach loop may result in indices being skipped. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::offsetUnset(mixed $key): void // ===== CODE $arrayiterator->offsetUnset( $key // mixed key - The offset to unset. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-23) // URL: https://www.php.net/manual/en/arrayiterator.offsetunset.php // ========== ARRAYITERATOR_OFFSETUNSET - END // SYNTAX: // void ArrayIterator::offsetUnset(mixed $key) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_OFFSETUNSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind array back to the start. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::rewind() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_rewind($arrayiterator) { // ========== ARRAYITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind array back to the start // ===== DESCRIPTION // This rewinds the iterator to the beginning. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::rewind(): void // ===== CODE $arrayiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayIterator::rewind() example // [php] // $arrayobject = new ArrayObject(); // // $arrayobject[] = 'zero'; // $arrayobject[] = 'one'; // $arrayobject[] = 'two'; // // $iterator = $arrayobject->getIterator(); // // $iterator->next(); // echo $iterator->key(); //1 // // $iterator->rewind(); //rewinding to the beginning // echo $iterator->key(); //0 // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-23) // URL: https://www.php.net/manual/en/arrayiterator.rewind.php // ========== ARRAYITERATOR_REWIND - END // SYNTAX: // void ArrayIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SEEK // ============================== PUBLIC // ============================== ABOUT // Seek to position. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::seek() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_seek($arrayiterator, $offset) { // ========== ARRAYITERATOR_SEEK - BEGIN // ===== ABOUT // Seek to position // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::seek(int $offset): void // ===== CODE $arrayiterator->seek( $offset // int offset - The position to seek to. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.seek.php // ========== ARRAYITERATOR_SEEK - END // SYNTAX: // void ArrayIterator::seek(int $offset) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SEEK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SERIALIZE // ============================== PUBLIC // ============================== ABOUT // Serialize. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::serialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_serialize($arrayiterator) { $return_arrayiterator_serialize = null; // ========== ARRAYITERATOR_SERIALIZE - BEGIN // ===== ABOUT // Serialize // ===== DESCRIPTION // Serialize. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::serialize(): string // ===== CODE $return_arrayiterator_serialize = $arrayiterator->serialize( // This function has no parameters. ); // Return Values // The serialized ArrayIterator. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.serialize.php // ========== ARRAYITERATOR_SERIALIZE - END // SYNTAX: // string ArrayIterator::serialize() return $return_arrayiterator_serialize; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // Set behaviour flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::setFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_setflags($arrayiterator, $flags) { // ========== ARRAYITERATOR_SETFLAGS - BEGIN // ===== ABOUT // Set behaviour flags // ===== DESCRIPTION // Set the flags that change the behavior of the ArrayIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::setFlags(int $flags): void // ===== CODE $arrayiterator->setFlags( $flags // int flags - The new ArrayIterator behavior. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. // The available behavior flags are listed below. The actual meanings of these flags are described in the predefined constants. // // ArrayIterator behavior flags // value - constant // 1 - ArrayIterator::STD_PROP_LIST // 2 - ArrayIterator::ARRAY_AS_PROPS ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.setflags.php // ========== ARRAYITERATOR_SETFLAGS - END // SYNTAX: // void ArrayIterator::setFlags(int $flags) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_SETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UASORT // ============================== PUBLIC // ============================== ABOUT // Sort with a user-defined comparison function and maintain index association. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::uasort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_uasort($arrayiterator, $callback) { $return_arrayiterator_uasort = false; // ========== ARRAYITERATOR_UASORT - BEGIN // ===== ABOUT // Sort with a user-defined comparison function and maintain index association // ===== DESCRIPTION // This method sorts the elements such that indices maintain their correlation with the values they are associated with, using a user-defined comparison function. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::uasort(callable $callback): true // ===== CODE $return_arrayiterator_uasort = $arrayiterator->uasort( $callback // callable callback - The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. // callback(mixed $a, mixed $b): int // Caution: Returning non-integer values from the comparison function, such as float, will result in an internal cast to int of the callback's return value. So values such as 0.99 and 0.1 will both be cast to an integer value of 0, which will compare such values as equal. ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.uasort.php // ========== ARRAYITERATOR_UASORT - END // SYNTAX: // bool ArrayIterator::uasort(callable $callback) return $return_arrayiterator_uasort; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UASORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UKSORT // ============================== PUBLIC // ============================== ABOUT // Sort by keys using a user-defined comparison function. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::uksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_uksort($arrayiterator, $callback) { $return_arrayiterator_uksort = false; // ========== ARRAYITERATOR_UKSORT - BEGIN // ===== ABOUT // Sort by keys using a user-defined comparison function // ===== DESCRIPTION // This method sorts the elements by keys using a user-supplied comparison function. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::uksort(callable $callback): true // ===== CODE $return_arrayiterator_uksort = $arrayiterator->uksort( $callback // callable callback - The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. // callback(mixed $a, mixed $b): int // Caution: Returning non-integer values from the comparison function, such as float, will result in an internal cast to int of the callback's return value. So values such as 0.99 and 0.1 will both be cast to an integer value of 0, which will compare such values as equal. ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.uksort.php // ========== ARRAYITERATOR_UKSORT - END // SYNTAX: // bool ArrayIterator::uksort(callable $callback) return $return_arrayiterator_uksort; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UKSORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UNSERIALIZE // ============================== PUBLIC // ============================== ABOUT // Unserialize. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::unserialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_unserialize($arrayiterator, $data) { // ========== ARRAYITERATOR_UNSERIALIZE - BEGIN // ===== ABOUT // Unserialize // ===== DESCRIPTION // Unserialize. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::unserialize(string $data): void // ===== CODE $arrayiterator->unserialize( $data // string data - The serialized ArrayIterator object to be unserialized. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.unserialize.php // ========== ARRAYITERATOR_UNSERIALIZE - END // SYNTAX: // void ArrayIterator::unserialize(string $data) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_UNSERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether array contains more entries. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_arrayiterator_valid($arrayiterator) { $return_arrayiterator_valid = false; // ========== ARRAYITERATOR_VALID - BEGIN // ===== ABOUT // Check whether array contains more entries // ===== DESCRIPTION // Checks if the array contains any more entries. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayIterator::valid(): bool // ===== CODE $return_arrayiterator_valid = $arrayiterator->valid( // This function has no parameters. ); // Return Values // Returns true if the iterator is valid, otherwise false // // [examples] // Examples // Example #1 ArrayIterator::valid() example // [example] // [php] // $array = array('1' => 'one'); // // $arrayobject = new ArrayObject($array); // $iterator = $arrayobject->getIterator(); // // var_dump($iterator->valid()); //bool(true) // // $iterator->next(); // advance to the next item // // //bool(false) because there is only one array element // var_dump($iterator->valid()); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayiterator.valid.php // ========== ARRAYITERATOR_VALID - END // SYNTAX: // bool ArrayIterator::valid() return $return_arrayiterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_ARRAYITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_CONSTRUCT - CachingIterator php_basic_spl_iterators_cachingiterator_construct(Iterator $iterator, int $flags = CachingIterator::CALL_TOSTRING) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_COUNT - int php_basic_spl_iterators_cachingiterator_count(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_CURRENT - mixed php_basic_spl_iterators_cachingiterator_current(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_GETCACHE - array php_basic_spl_iterators_cachingiterator_getcache(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_GETFLAGS - int php_basic_spl_iterators_cachingiterator_getflags(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_HASNEXT - bool php_basic_spl_iterators_cachingiterator_hasnext(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_KEY - scalar php_basic_spl_iterators_cachingiterator_key(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_NEXT - void php_basic_spl_iterators_cachingiterator_next(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETEXISTS - bool php_basic_spl_iterators_cachingiterator_offsetexists(CachingIterator $cachingiterator, string $key) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETGET - mixed php_basic_spl_iterators_cachingiterator_offsetget(CachingIterator $cachingiterator, string $key) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETSET - void php_basic_spl_iterators_cachingiterator_offsetset(CachingIterator $cachingiterator, string $key, mixed $value) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETUNSET - void php_basic_spl_iterators_cachingiterator_offsetunset(CachingIterator $cachingiterator, string $key) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_REWIND - void php_basic_spl_iterators_cachingiterator_rewind(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_SETFLAGS - void php_basic_spl_iterators_cachingiterator_setflags(CachingIterator $cachingiterator, int $flags) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_TOSTRING - string php_basic_spl_iterators_cachingiterator_tostring(CachingIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_VALID - bool php_basic_spl_iterators_cachingiterator_valid(CachingIterator $cachingiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (16) // CachingIterator::__construct() - PHP_5, PHP_7, PHP_8 // CachingIterator::count() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // CachingIterator::current() - PHP_5, PHP_7, PHP_8 // CachingIterator::getCache() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::getFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::hasNext() - PHP_5, PHP_7, PHP_8 // CachingIterator::key() - PHP_5, PHP_7, PHP_8 // CachingIterator::next() - PHP_5, PHP_7, PHP_8 // CachingIterator::offsetExists() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::offsetGet() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::offsetSet() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::offsetUnset() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::rewind() - PHP_5, PHP_7, PHP_8 // CachingIterator::setFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // CachingIterator::__toString() - PHP_5, PHP_7, PHP_8 // CachingIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (9) // CachingIterator - PHP_5, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // int // mixed // array // bool // scalar // void // string // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a new CachingIterator object for the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::__construct() - PHP_5, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // CachingIterator::CALL_TOSTRING - CachingIterator::__construct() // ============================== CODE function php_basic_spl_iterators_cachingiterator_construct($iterator, $flags = CachingIterator::CALL_TOSTRING) { $return_cachingiterator_construct = null; // ========== CACHINGITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a new CachingIterator object for the iterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::__construct(Iterator $iterator, int $flags = CachingIterator::CALL_TOSTRING) // ===== CODE $return_cachingiterator_construct = new CachingIterator( $iterator, // Iterator iterator - Iterator to cache $flags // int flags - Bitmask of flags. ); // Return // CachingIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.construct.php // ========== CACHINGITERATOR_CONSTRUCT - END // SYNTAX: // CachingIterator CachingIterator::__construct(Iterator $iterator, int $flags = CachingIterator::CALL_TOSTRING) return $return_cachingiterator_construct; // CachingIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_COUNT // ============================== PUBLIC // ============================== ABOUT // The number of elements in the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::count() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_count($cachingiterator) { $return_cachingiterator_count = 0; // ========== CACHINGITERATOR_COUNT - BEGIN // ===== ABOUT // The number of elements in the iterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // May return the number of elements in the iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::count(): int // ===== CODE $return_cachingiterator_count = $cachingiterator->count( // This function has no parameters. ); // Return Values // The count of the elements iterated over. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.count.php // ========== CACHINGITERATOR_COUNT - END // SYNTAX: // int CachingIterator::count() return $return_cachingiterator_count; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Return the current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::current() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_current($cachingiterator) { $return_cachingiterator_current = null; // ========== CACHINGITERATOR_CURRENT - BEGIN // ===== ABOUT // Return the current element // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // May return the current element in the iteration. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::current(): mixed // ===== CODE $return_cachingiterator_current = $cachingiterator->current( // This function has no parameters. ); // Return Values // Mixed // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.current.php // ========== CACHINGITERATOR_CURRENT - END // SYNTAX: // mixed CachingIterator::current() return $return_cachingiterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_GETCACHE // ============================== PUBLIC // ============================== ABOUT // Retrieve the contents of the cache. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::getCache() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_getcache($cachingiterator) { $return_cachingiterator_getcache = null; // ========== CACHINGITERATOR_GETCACHE - BEGIN // ===== ABOUT // Retrieve the contents of the cache // ===== DESCRIPTION // Retrieve the contents of the cache. // Note: The CachingIterator::FULL_CACHE flag must be being used. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::getCache(): array // ===== CODE $return_cachingiterator_getcache = $cachingiterator->getCache( // This function has no parameters. ); // Return Values // An array containing the cache items. // // Errors/Exceptions // Throws a BadMethodCallException when the CachingIterator::FULL_CACHE flag is not being used. // // [examples] // Examples // [example] // Example #1 CachingIterator::getCache() example // [php] // $iterator = new ArrayIterator(array(1, 2, 3)); // $cache = new CachingIterator($iterator, CachingIterator::FULL_CACHE); // // $cache->next(); // $cache->next(); // var_dump($cache->getCache()); // // $cache->next(); // var_dump($cache->getCache()); // [/php] // The above example will output: // [result] // array(2) { // [0]=> // int(1) // [1]=> // int(2) // } // array(3) { // [0]=> // int(1) // [1]=> // int(2) // [2]=> // int(3) // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.getcache.php // ========== CACHINGITERATOR_GETCACHE - END // SYNTAX: // array CachingIterator::getCache() return $return_cachingiterator_getcache; // array } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_GETCACHE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Get flags used. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::getFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_getflags($cachingiterator) { $return_cachingiterator_getflags = 0; // ========== CACHINGITERATOR_GETFLAGS - BEGIN // ===== ABOUT // Get flags used // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Get the bitmask of the flags used for this CachingIterator instance. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::getFlags(): int // ===== CODE $return_cachingiterator_getflags = $cachingiterator->getFlags( // This function has no parameters. ); // Return Values // Description... // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.getflags.php // ========== CACHINGITERATOR_GETFLAGS - END // SYNTAX: // int CachingIterator::getFlags() return $return_cachingiterator_getflags; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_HASNEXT // ============================== PUBLIC // ============================== ABOUT // Check whether the inner iterator has a valid next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::hasNext() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_hasnext($cachingiterator) { $return_cachingiterator_hasnext = false; // ========== CACHINGITERATOR_HASNEXT - BEGIN // ===== ABOUT // Check whether the inner iterator has a valid next element // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::hasNext(): bool // ===== CODE $return_cachingiterator_hasnext = $cachingiterator->hasNext( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.hasnext.php // ========== CACHINGITERATOR_HASNEXT - END // SYNTAX: // bool CachingIterator::hasNext() return $return_cachingiterator_hasnext; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_HASNEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Return the key for the current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::key() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_key($cachingiterator) { $return_cachingiterator_key = null; // ========== CACHINGITERATOR_KEY - BEGIN // ===== ABOUT // Return the key for the current element // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // This method may return a key for the current element. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::key(): scalar // ===== CODE $return_cachingiterator_key = $cachingiterator->key( // This function has no parameters. ); // Return // scalar // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.key.php // ========== CACHINGITERATOR_KEY - END // SYNTAX: // scalar CachingIterator::key() return $return_cachingiterator_key; // scalar } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move the iterator forward. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::next() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_next($cachingiterator) { // ========== CACHINGITERATOR_NEXT - BEGIN // ===== ABOUT // Move the iterator forward // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Move the iterator forward. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::next(): void // ===== CODE $cachingiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.next.php // ========== CACHINGITERATOR_NEXT - END // SYNTAX: // void CachingIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETEXISTS // ============================== PUBLIC // ============================== ABOUT // The offsetExists purpose. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::offsetExists() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_offsetexists($cachingiterator, $key) { $return_cachingiterator_offsetexists = false; // ========== CACHINGITERATOR_OFFSETEXISTS - BEGIN // ===== ABOUT // The offsetExists purpose // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::offsetExists(string $key): bool // ===== CODE $return_cachingiterator_offsetexists = $cachingiterator->offsetExists( $key // string key - The index being checked. ); // Return Values // Returns true if an entry referenced by the offset exists, false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.offsetexists.php // ========== CACHINGITERATOR_OFFSETEXISTS - END // SYNTAX: // bool CachingIterator::offsetExists(string $key) return $return_cachingiterator_offsetexists; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETEXISTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETGET // ============================== PUBLIC // ============================== ABOUT // The offsetGet purpose. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::offsetGet() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_offsetget($cachingiterator, $key) { $return_cachingiterator_offsetget = null; // ========== CACHINGITERATOR_OFFSETGET - BEGIN // ===== ABOUT // The offsetGet purpose // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::offsetGet(string $key): mixed // ===== CODE $return_cachingiterator_offsetget = $cachingiterator->offsetGet( $key // string key - Description... ); // Return Values // Description... // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.offsetget.php // ========== CACHINGITERATOR_OFFSETGET - END // SYNTAX: // mixed CachingIterator::offsetGet(string $key) return $return_cachingiterator_offsetget; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETGET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETSET // ============================== PUBLIC // ============================== ABOUT // The offsetSet purpose. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::offsetSet() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_offsetset($cachingiterator, $key, $value) { // ========== CACHINGITERATOR_OFFSETSET - BEGIN // ===== ABOUT // The offsetSet purpose // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::offsetSet(string $key, mixed $value): void // ===== CODE $cachingiterator->offsetSet( $key, // string key - The index of the element to be set. $value // mixed value - The new value for the key. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.offsetset.php // ========== CACHINGITERATOR_OFFSETSET - END // SYNTAX: // void CachingIterator::offsetSet(string $key, mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETUNSET // ============================== PUBLIC // ============================== ABOUT // The offsetUnset purpose. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::offsetUnset() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_offsetunset($cachingiterator, $key) { // ========== CACHINGITERATOR_OFFSETUNSET - BEGIN // ===== ABOUT // The offsetUnset purpose // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::offsetUnset(string $key): void // ===== CODE $cachingiterator->offsetUnset( $key // string key - The index of the element to be unset. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.offsetunset.php // ========== CACHINGITERATOR_OFFSETUNSET - END // SYNTAX: // void CachingIterator::offsetUnset(string $key) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_OFFSETUNSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::rewind() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_rewind($cachingiterator) { // ========== CACHINGITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind the iterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Rewind the iterator. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::rewind(): void // ===== CODE $cachingiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.rewind.php // ========== CACHINGITERATOR_REWIND - END // SYNTAX: // void CachingIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // The setFlags purpose. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::setFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_setflags($cachingiterator, $flags) { // ========== CACHINGITERATOR_SETFLAGS - BEGIN // ===== ABOUT // The setFlags purpose // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Set the flags for the CachingIterator object. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::setFlags(int $flags): void // ===== CODE $cachingiterator->setFlags( $flags // int flags - Bitmask of the flags to set. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.setflags.php // ========== CACHINGITERATOR_SETFLAGS - END // SYNTAX: // void CachingIterator::setFlags(int $flags) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_SETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Return the string representation of the current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_tostring($cachingiterator) { $return_cachingiterator_tostring = null; // ========== CACHINGITERATOR_TOSTRING - BEGIN // ===== ABOUT // Return the string representation of the current element // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Get the string representation of the current element. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::__toString(): string // ===== CODE $return_cachingiterator_tostring = $cachingiterator->__toString( // This function has no parameters. ); // Return Values // The string representation of the current element. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.tostring.php // ========== CACHINGITERATOR_TOSTRING - END // SYNTAX: // string CachingIterator::__toString() return $return_cachingiterator_tostring; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_TOSTRING // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the current element is valid. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CachingIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_cachingiterator_valid($cachingiterator) { $return_cachingiterator_valid = false; // ========== CACHINGITERATOR_VALID - BEGIN // ===== ABOUT // Check whether the current element is valid // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Check whether the current element is valid. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public CachingIterator::valid(): bool // ===== CODE $return_cachingiterator_valid = $cachingiterator->valid( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/cachingiterator.valid.php // ========== CACHINGITERATOR_VALID - END // SYNTAX: // bool CachingIterator::valid() return $return_cachingiterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_CACHINGITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR_ACCEPT - CallbackFilterIterator php_basic_spl_iterators_callbackfilteriterator_accept(CallbackFilterIterator $cachingiterator) // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR_CONSTRUCT - CallbackFilterIterator php_basic_spl_iterators_callbackfilteriterator_construct(Iterator $iterator, callable $callback) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // CallbackFilterIterator::accept() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // CallbackFilterIterator::__construct() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // CallbackFilterIterator - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // callable // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR_ACCEPT // ============================== PUBLIC // ============================== ABOUT // Calls the callback with the current value, the current key and the inner iterator as arguments. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CallbackFilterIterator::accept() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_callbackfilteriterator_accept($cachingiterator) { $return_callbackfilteriterator_accept = false; // ========== CALLBACKFILTERITERATOR_ACCEPT - BEGIN // ===== ABOUT // Calls the callback with the current value, the current key and the inner iterator as arguments // ===== DESCRIPTION // This method calls the callback with the current value, current key and the inner iterator. // The callback is expected to return true if the current item is to be accepted, or false otherwise. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public CallbackFilterIterator::accept(): bool // ===== CODE $return_callbackfilteriterator_accept = $cachingiterator->accept( // This function has no parameters. ); // Return Values // Returns true to accept the current item, or false otherwise. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/callbackfilteriterator.accept.php // ========== CALLBACKFILTERITERATOR_ACCEPT - END // SYNTAX: // bool CallbackFilterIterator::accept() return $return_callbackfilteriterator_accept; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR_ACCEPT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Create a filtered iterator from another iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CallbackFilterIterator::__construct() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_callbackfilteriterator_construct($iterator, $callback) { $return_callbackfilteriterator_construct = null; // ========== CALLBACKFILTERITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Create a filtered iterator from another iterator // ===== DESCRIPTION // Creates a filtered iterator using the callback to determine which items are accepted or rejected. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public CallbackFilterIterator::__construct(Iterator $iterator, callable $callback) // ===== CODE $return_callbackfilteriterator_construct = new CallbackFilterIterator( $iterator, // Iterator iterator - The iterator to be filtered. $callback // callable callback - The callback, which should return true to accept the current item or false otherwise. See Examples. // May be any valid callable value. ); // Return // CallbackFilterIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/callbackfilteriterator.construct.php // ========== CALLBACKFILTERITERATOR_CONSTRUCT - END // SYNTAX: // CallbackFilterIterator CallbackFilterIterator::__construct(Iterator $iterator, callable $callback) return $return_callbackfilteriterator_construct; // CallbackFilterIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR_CONSTRUCT // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_CALLBACKFILTERITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_CONSTRUCT - DirectoryIterator php_basic_spl_iterators_directoryiterator_construct(string $directory) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_CURRENT - mixed php_basic_spl_iterators_directoryiterator_current(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETBASENAME - string php_basic_spl_iterators_directoryiterator_getbasename(DirectoryIterator $directoryiterator, string $suffix = "") // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETEXTENSION - string php_basic_spl_iterators_directoryiterator_getextension(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETFILENAME - string php_basic_spl_iterators_directoryiterator_getfilename(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_ISDOT - bool php_basic_spl_iterators_directoryiterator_isdot(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_KEY - mixed php_basic_spl_iterators_directoryiterator_key(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_NEXT - void php_basic_spl_iterators_directoryiterator_next(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_REWIND - void php_basic_spl_iterators_directoryiterator_rewind(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_SEEK - void php_basic_spl_iterators_directoryiterator_seek(DirectoryIterator $directoryiterator, int $offset) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_TOSTRING - string php_basic_spl_iterators_directoryiterator_tostring(DirectoryIterator $directoryiterator) // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_VALID - bool php_basic_spl_iterators_directoryiterator_valid(DirectoryIterator $directoryiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (12) // DirectoryIterator::__construct() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::current() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::getBasename() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // DirectoryIterator::getExtension() - PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // DirectoryIterator::getFilename() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::isDot() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::key() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::next() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::rewind() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::seek() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // DirectoryIterator::__toString() - PHP_5, PHP_7, PHP_8 // DirectoryIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (6) // DirectoryIterator - PHP_5, PHP_7, PHP_8 // string // mixed // bool // void // int // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a new directory iterator from a path. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_construct($directory) { $return_directoryiterator_construct = null; // ========== DIRECTORYITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a new directory iterator from a path // ===== DESCRIPTION // Constructs a new directory iterator from a path. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::__construct(string $directory) // ===== CODE $return_directoryiterator_construct = new DirectoryIterator( $directory // string directory - The path of the directory to traverse. ); // Return // DirectoryIterator // // Errors/Exceptions // Throws an UnexpectedValueException if the directory does not exist. // Throws a ValueError if the directory is an empty string. // // Changelog // Version - Description // 8.0.0 - Now throws a ValueError if directory is an empty string; previously it threw a RuntimeException. // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::__construct() example // This example will list the contents of the directory containing the script. // [php] // $dir = new DirectoryIterator(dirname(__FILE__)); // foreach ($dir as $fileinfo) { // if (!$fileinfo->isDot()) { // var_dump($fileinfo->getFilename()); // } // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.construct.php // ========== DIRECTORYITERATOR_CONSTRUCT - END // SYNTAX: // DirectoryIterator DirectoryIterator::__construct(string $directory) return $return_directoryiterator_construct; // DirectoryIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Return the current DirectoryIterator item. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::current() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_current($directoryiterator) { $return_directoryiterator_current = null; // ========== DIRECTORYITERATOR_CURRENT - BEGIN // ===== ABOUT // Return the current DirectoryIterator item // ===== DESCRIPTION // Get the current DirectoryIterator item. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::current(): mixed // ===== CODE $return_directoryiterator_current = $directoryiterator->current( // This function has no parameters. ); // Return Values // The current DirectoryIterator item. // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::current() example // This example will list the contents of the directory containing the script. // [php] // $iterator = new DirectoryIterator(__DIR__); // while($iterator->valid()) { // $file = $iterator->current(); // echo $iterator->key() . " => " . $file->getFilename() . "\n"; // $iterator->next(); // } // [/php] // The above example will output something similar to: // [result] // 0 => . // 1 => .. // 2 => apple.jpg // 3 => banana.jpg // 4 => index.php // 5 => pear.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.current.php // ========== DIRECTORYITERATOR_CURRENT - END // SYNTAX: // mixed DirectoryIterator::current() return $return_directoryiterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETBASENAME // ============================== PUBLIC // ============================== ABOUT // Get base name of current DirectoryIterator item. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::getBasename() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_getbasename($directoryiterator, $suffix = "") { $return_directoryiterator_getbasename = null; // ========== DIRECTORYITERATOR_GETBASENAME - BEGIN // ===== ABOUT // Get base name of current DirectoryIterator item // ===== DESCRIPTION // Get the base name of the current DirectoryIterator item. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::getBasename(string $suffix = ""): string // ===== CODE $return_directoryiterator_getbasename = $directoryiterator->getBasename( $suffix // string suffix - If the base name ends in suffix, this will be cut. ); // Return Values // The base name of the current DirectoryIterator item. // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::getBasename() example // This example will list the full base name and the base name with suffix .jpg removed for the files in the directory containing the script. // [php] // $dir = new DirectoryIterator(dirname(__FILE__)); // foreach ($dir as $fileinfo) { // if ($fileinfo->isFile()) { // echo $fileinfo->getBasename() . "\n"; // echo $fileinfo->getBasename('.jpg') . "\n"; // } // } // [/php] // The above example will output something similar to: // [result] // apple.jpg // apple // banana.jpg // banana // index.php // index.php // pear.jpg // pear // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.getbasename.php // ========== DIRECTORYITERATOR_GETBASENAME - END // SYNTAX: // string DirectoryIterator::getBasename(string $suffix = "") return $return_directoryiterator_getbasename; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETBASENAME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETEXTENSION // ============================== PUBLIC // ============================== ABOUT // Gets the file extension. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::getExtension() - PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_getextension($directoryiterator) { $return_directoryiterator_getextension = null; // ========== DIRECTORYITERATOR_GETEXTENSION - BEGIN // ===== ABOUT // Gets the file extension // ===== DESCRIPTION // Retrieves the file extension. // ===== SUPPORTED // PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::getExtension(): string // ===== CODE $return_directoryiterator_getextension = $directoryiterator->getExtension( // This function has no parameters. ); // Return Values // Returns a string containing the file extension, or an empty string if the file has no extension. // // [examples] // Examples // [example] // Example #1 DirectoryIterator::getExtension() example // [php] // // $directory = new DirectoryIterator(__DIR__); // foreach ($directory as $fileinfo) { // if ($fileinfo->isFile()) { // echo $fileinfo->getExtension() . "\n"; // } // } // // [/php] // The above example will output something similar to: // [result] // php // txt // jpg // gz // [/result] // [/example] // [/examples] // // Notes // Note: Another way of getting the extension is to use the pathinfo() function. // [php] // $extension = pathinfo($fileinfo->getFilename(), PATHINFO_EXTENSION); // [/php] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.getextension.php // ========== DIRECTORYITERATOR_GETEXTENSION - END // SYNTAX: // string DirectoryIterator::getExtension() return $return_directoryiterator_getextension; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETEXTENSION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETFILENAME // ============================== PUBLIC // ============================== ABOUT // Return file name of current DirectoryIterator item. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::getFilename() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_getfilename($directoryiterator) { $return_directoryiterator_getfilename = null; // ========== DIRECTORYITERATOR_GETFILENAME - BEGIN // ===== ABOUT // Return file name of current DirectoryIterator item // ===== DESCRIPTION // Get the file name of the current DirectoryIterator item. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::getFilename(): string // ===== CODE $return_directoryiterator_getfilename = $directoryiterator->getFilename( // This function has no parameters. ); // Return Values // Returns the file name of the current DirectoryIterator item. // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::getFilename() example // This example will list the contents of the directory containing the script. // [php] // $dir = new DirectoryIterator(dirname(__FILE__)); // foreach ($dir as $fileinfo) { // echo $fileinfo->getFilename() . "\n"; // } // [/php] // The above example will output something similar to: // [result] // . // .. // apple.jpg // banana.jpg // index.php // pear.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.getfilename.php // ========== DIRECTORYITERATOR_GETFILENAME - END // SYNTAX: // string DirectoryIterator::getFilename() return $return_directoryiterator_getfilename; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_GETFILENAME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_ISDOT // ============================== PUBLIC // ============================== ABOUT // Determine if current DirectoryIterator item is '.' or '..'. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::isDot() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_isdot($directoryiterator) { $return_directoryiterator_isdot = false; // ========== DIRECTORYITERATOR_ISDOT - BEGIN // ===== ABOUT // Determine if current DirectoryIterator item is '.' or '..' // ===== DESCRIPTION // Determines if the current DirectoryIterator item is a directory and either . or .. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::isDot(): bool // ===== CODE $return_directoryiterator_isdot = $directoryiterator->isDot( // This function has no parameters. ); // Return Values // true if the entry is . or .., otherwise false // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::isDot() example // This example will list all files, omitting the . and .. entries. // [php] // $iterator = new DirectoryIterator(dirname(__FILE__)); // foreach ($iterator as $fileinfo) { // if (!$fileinfo->isDot()) { // echo $fileinfo->getFilename() . "\n"; // } // } // [/php] // The above example will output something similar to: // [result] // apple.jpg // banana.jpg // example.php // pears.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.isdot.php // ========== DIRECTORYITERATOR_ISDOT - END // SYNTAX: // bool DirectoryIterator::isDot() return $return_directoryiterator_isdot; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_ISDOT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Return the key for the current DirectoryIterator item. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::key() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_key($directoryiterator) { $return_directoryiterator_key = null; // ========== DIRECTORYITERATOR_KEY - BEGIN // ===== ABOUT // Return the key for the current DirectoryIterator item // ===== DESCRIPTION // Get the key for the current DirectoryIterator item. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::key(): mixed // ===== CODE $return_directoryiterator_key = $directoryiterator->key( // This function has no parameters. ); // Return Values // The key for the current DirectoryIterator item as an int. // // Changelog // Version - Description // 8.1.0 - When the iterator is uninitialized, an Error is thrown now. Previously, the method returned false. // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::key() example // [php] // $dir = new DirectoryIterator(dirname(__FILE__)); // foreach ($dir as $fileinfo) { // if (!$fileinfo->isDot()) { // echo $fileinfo->key() . " => " . $fileinfo->getFilename() . "\n"; // } // } // [/php] // The above example will output something similar to: // [result] // 0 => apple.jpg // 1 => banana.jpg // 2 => index.php // 3 => pear.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.key.php // ========== DIRECTORYITERATOR_KEY - END // SYNTAX: // mixed DirectoryIterator::key() return $return_directoryiterator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move forward to next DirectoryIterator item. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::next() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_next($directoryiterator) { // ========== DIRECTORYITERATOR_NEXT - BEGIN // ===== ABOUT // Move forward to next DirectoryIterator item // ===== DESCRIPTION // Move forward to the next DirectoryIterator item. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::next(): void // ===== CODE $directoryiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 DirectoryIterator::next() example // List the contents of a directory using a while loop. // [php] // $iterator = new DirectoryIterator(dirname(__FILE__)); // while($iterator->valid()) { // echo $iterator->getFilename() . "\n"; // $iterator->next(); // } // [/php] // The above example will output something similar to: // [result] // . // .. // apple.jpg // banana.jpg // index.php // pear.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.next.php // ========== DIRECTORYITERATOR_NEXT - END // SYNTAX: // void DirectoryIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the DirectoryIterator back to the start. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::rewind() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_rewind($directoryiterator) { // ========== DIRECTORYITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind the DirectoryIterator back to the start // ===== DESCRIPTION // Rewind the DirectoryIterator back to the start. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::rewind(): void // ===== CODE $directoryiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 DirectoryIterator::rewind() example // [php] // $iterator = new DirectoryIterator(dirname(__FILE__)); // // $iterator->next(); // echo $iterator->key(); //1 // // $iterator->rewind(); //rewinding to the beginning // echo $iterator->key(); //0 // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.rewind.php // ========== DIRECTORYITERATOR_REWIND - END // SYNTAX: // void DirectoryIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_SEEK // ============================== PUBLIC // ============================== ABOUT // Seek to a DirectoryIterator item. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::seek() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_seek($directoryiterator, $offset) { // ========== DIRECTORYITERATOR_SEEK - BEGIN // ===== ABOUT // Seek to a DirectoryIterator item // ===== DESCRIPTION // Seek to a given position in the DirectoryIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::seek(int $offset): void // ===== CODE $directoryiterator->seek( $offset // int offset - The zero-based numeric position to seek to. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 DirectoryIterator::seek() example // Seek to the fourth item in the directory containing the script. The first two are usually . and .. // [php] // $iterator = new DirectoryIterator(dirname(__FILE__)); // $iterator->seek(3); // if ($iterator->valid()) { // echo $iterator->getFilename(); // } else { // echo 'No file at position 3'; // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.seek.php // ========== DIRECTORYITERATOR_SEEK - END // SYNTAX: // void DirectoryIterator::seek(int $offset) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_SEEK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Get file name as a string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::__toString() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_tostring($directoryiterator) { $return_directoryiterator_tostring = null; // ========== DIRECTORYITERATOR_TOSTRING - BEGIN // ===== ABOUT // Get file name as a string // ===== DESCRIPTION // Get the file name of the current DirectoryIterator item. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::__toString(): string // ===== CODE $return_directoryiterator_tostring = $directoryiterator->__toString( // This function has no parameters. ); // Return Values // Returns the file name of the current DirectoryIterator item. // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::__toString() example // This example will list the contents of the directory containing the script. // [php] // $dir = new DirectoryIterator(dirname(__FILE__)); // foreach ($dir as $fileinfo) { // echo $fileinfo; // } // [/php] // The above example will output something similar to: // [result] // . // .. // apple.jpg // banana.jpg // index.php // pear.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.tostring.php // ========== DIRECTORYITERATOR_TOSTRING - END // SYNTAX: // string DirectoryIterator::__toString() return $return_directoryiterator_tostring; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_TOSTRING // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether current DirectoryIterator position is a valid file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // DirectoryIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_directoryiterator_valid($directoryiterator) { $return_directoryiterator_valid = false; // ========== DIRECTORYITERATOR_VALID - BEGIN // ===== ABOUT // Check whether current DirectoryIterator position is a valid file // ===== DESCRIPTION // Check whether current DirectoryIterator position is a valid file. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public DirectoryIterator::valid(): bool // ===== CODE $return_directoryiterator_valid = $directoryiterator->valid( // This function has no parameters. ); // Return Values // Returns true if the position is valid, otherwise false // // [examples] // Examples // [example] // Example #1 A DirectoryIterator::valid() example // [php] // $iterator = new DirectoryIterator(dirname(__FILE__)); // // // Loop to end of iterator // while($iterator->valid()) { // $iterator->next(); // } // // $iterator->valid(); // FALSE // $iterator->rewind(); // $iterator->valid(); // TRUE // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/directoryiterator.valid.php // ========== DIRECTORYITERATOR_VALID - END // SYNTAX: // bool DirectoryIterator::valid() return $return_directoryiterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_DIRECTORYITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_CURRENT - never php_basic_spl_iterators_emptyiterator_current(EmptyIterator $emptyiterator) // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_KEY - never php_basic_spl_iterators_emptyiterator_key(EmptyIterator $emptyiterator) // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_NEXT - void php_basic_spl_iterators_emptyiterator_next(EmptyIterator $emptyiterator) // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_REWIND - void php_basic_spl_iterators_emptyiterator_rewind(EmptyIterator $emptyiterator) // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_VALID - bool php_basic_spl_iterators_emptyiterator_valid(EmptyIterator $emptyiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (5) // EmptyIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // EmptyIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // EmptyIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // EmptyIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // EmptyIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (4) // never // EmptyIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // void // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // The current() method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // EmptyIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_emptyiterator_current($emptyiterator) { $return_emptyiterator_current = null; // ========== EMPTYITERATOR_CURRENT - BEGIN // ===== ABOUT // The current() method // ===== DESCRIPTION // This function must not be called. It throws an exception upon access. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public EmptyIterator::current(): never // ===== CODE $return_emptyiterator_current = $emptyiterator->current( // This function has no parameters. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws an Exception if called. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/emptyiterator.current.php // ========== EMPTYITERATOR_CURRENT - END // SYNTAX: // never EmptyIterator::current() return $return_emptyiterator_current; // never } // ============================== END // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // The key() method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // EmptyIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_emptyiterator_key($emptyiterator) { $return_emptyiterator_key = null; // ========== EMPTYITERATOR_KEY - BEGIN // ===== ABOUT // The key() method // ===== DESCRIPTION // This function must not be called. It throws an exception upon access. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public EmptyIterator::key(): never // ===== CODE $return_emptyiterator_key = $emptyiterator->key( // This function has no parameters. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws an Exception if called. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/emptyiterator.key.php // ========== EMPTYITERATOR_KEY - END // SYNTAX: // never EmptyIterator::key() return $return_emptyiterator_key; // never } // ============================== END // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // The next() method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // EmptyIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_emptyiterator_next($emptyiterator) { // ========== EMPTYITERATOR_NEXT - BEGIN // ===== ABOUT // The next() method // ===== DESCRIPTION // No operation, nothing to do. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public EmptyIterator::next(): void // ===== CODE $emptyiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/emptyiterator.next.php // ========== EMPTYITERATOR_NEXT - END // SYNTAX: // void EmptyIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // The rewind() method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // EmptyIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_emptyiterator_rewind($emptyiterator) { // ========== EMPTYITERATOR_REWIND - BEGIN // ===== ABOUT // The rewind() method // ===== DESCRIPTION // No operation, nothing to do. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public EmptyIterator::rewind(): void // ===== CODE $emptyiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/emptyiterator.rewind.php // ========== EMPTYITERATOR_REWIND - END // SYNTAX: // void EmptyIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // The valid() method. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // EmptyIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_emptyiterator_valid($emptyiterator) { $return_emptyiterator_valid = false; // ========== EMPTYITERATOR_VALID - BEGIN // ===== ABOUT // The valid() method // ===== DESCRIPTION // The EmptyIterator valid() method. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public EmptyIterator::valid(): false // ===== CODE $return_emptyiterator_valid = $emptyiterator->valid( // This function has no parameters. ); // Return Values // false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/emptyiterator.valid.php // ========== EMPTYITERATOR_VALID - END // SYNTAX: // bool EmptyIterator::valid() return $return_emptyiterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_EMPTYITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_CONSTRUCT - FilesystemIterator php_basic_spl_iterators_filesystemiterator_construct(string $directory, int $flags) // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_CURRENT - string|SplFileInfo|FilesystemIterator php_basic_spl_iterators_filesystemiterator_current(FilesystemIterator $filesystemiterator) // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_GETFLAGS - int php_basic_spl_iterators_filesystemiterator_getflags(FilesystemIterator $filesystemiterator) // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_KEY - string php_basic_spl_iterators_filesystemiterator_key(FilesystemIterator $filesystemiterator) // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_NEXT - void php_basic_spl_iterators_filesystemiterator_next(FilesystemIterator $filesystemiterator) // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_REWIND - void php_basic_spl_iterators_filesystemiterator_rewind(FilesystemIterator $filesystemiterator) // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_SETFLAGS - void php_basic_spl_iterators_filesystemiterator_setflags(FilesystemIterator $filesystemiterator, int $flags) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (7) // FilesystemIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // FilesystemIterator::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // FilesystemIterator::getFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // FilesystemIterator::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // FilesystemIterator::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // FilesystemIterator::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // FilesystemIterator::setFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // FilesystemIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // string // int // SplFileInfo - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a new filesystem iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_construct($directory, $flags) { $return_filesystemiterator_construct = null; // ========== FILESYSTEMITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a new filesystem iterator // ===== DESCRIPTION // Constructs a new filesystem iterator from the directory. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::__construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS) // ===== CODE $return_filesystemiterator_construct = new FilesystemIterator( $directory, // string directory - The path of the filesystem item to be iterated over. $flags // int flags - Flags may be provided which will affect the behavior of some methods. A list of the flags can found under FilesystemIterator predefined constants. They can also be set later with FilesystemIterator::setFlags() ); // Return // FilesystemIterator // // Errors/Exceptions // Throws an UnexpectedValueException if the directory does not exist. // Throws a ValueError if the directory is an empty string. // // Changelog // Version - Description // 8.2.0 - Prior to PHP 8.2.0, FilesystemIterator::SKIP_DOTS was always set and could not be removed. // 8.0.0 - Now throws a ValueError if directory is an empty string; previously it threw a RuntimeException. // // [examples] // Examples // [example] // Example #1 FilesystemIterator::__construct() example // [php] // $it = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::CURRENT_AS_FILEINFO); // foreach ($it as $fileinfo) { // echo $fileinfo->getFilename() . "\n"; // } // [/php] // Output of the above example in PHP 8.2 is similar to: // [result] // . // .. // apples.jpg // banana.jpg // example.php // [/result] // Output of the above example prior to PHP 8.2.0 is similar to: // [result] // apples.jpg // banana.jpg // example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.construct.php // ========== FILESYSTEMITERATOR_CONSTRUCT - END // SYNTAX: // FilesystemIterator FilesystemIterator::__construct(string $directory, int $flags) return $return_filesystemiterator_construct; // FilesystemIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // The current file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_current($filesystemiterator) { $return_filesystemiterator_current = null; // ========== FILESYSTEMITERATOR_CURRENT - BEGIN // ===== ABOUT // The current file // ===== DESCRIPTION // Get file information of the current element. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::current(): string|SplFileInfo|FilesystemIterator // ===== CODE $return_filesystemiterator_current = $filesystemiterator->current( // This function has no parameters. ); // Return Values // The filename, file information, or $this depending on the set flags. See the FilesystemIterator constants. // // [examples] // Examples // [example] // Example #1 FilesystemIterator::current() example // This example will list the contents of the directory containing the script. // [php] // $iterator = new FilesystemIterator(__DIR__, FilesystemIterator::CURRENT_AS_PATHNAME); // foreach ($iterator as $fileinfo) { // echo $iterator->current() . "\n"; // } // [/php] // Output of the above example in PHP 8.2 is similar to: // [result] // /www/examples/. // /www/examples/.. // /www/examples/apple.jpg // /www/examples/banana.jpg // /www/examples/example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.current.php // ========== FILESYSTEMITERATOR_CURRENT - END // SYNTAX: // string|SplFileInfo|FilesystemIterator FilesystemIterator::current() return $return_filesystemiterator_current; // string|SplFileInfo|FilesystemIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Get the handling flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::getFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_getflags($filesystemiterator) { $return_filesystemiterator_getflags = 0; // ========== FILESYSTEMITERATOR_GETFLAGS - BEGIN // ===== ABOUT // Get the handling flags // ===== DESCRIPTION // Gets the handling flags, as set in FilesystemIterator::__construct() or FilesystemIterator::setFlags(). // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::getFlags(): int // ===== CODE $return_filesystemiterator_getflags = $filesystemiterator->getFlags( // This function has no parameters. ); // Return Values // The integer value of the set flags. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.getflags.php // ========== FILESYSTEMITERATOR_GETFLAGS - END // SYNTAX: // int FilesystemIterator::getFlags() return $return_filesystemiterator_getflags; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Retrieve the key for the current file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_key($filesystemiterator) { $return_filesystemiterator_key = null; // ========== FILESYSTEMITERATOR_KEY - BEGIN // ===== ABOUT // Retrieve the key for the current file // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::key(): string // ===== CODE $return_filesystemiterator_key = $filesystemiterator->key( // This function has no parameters. ); // Return Values // Returns the pathname or filename depending on the set flags. See the FilesystemIterator constants. // // [examples] // Examples // [example] // Example #1 FilesystemIterator::key() example // This example will list the contents of the directory containing the script. // [php] // $iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_FILENAME); // foreach ($iterator as $fileinfo) { // echo $iterator->key() . "\n"; // } // [/php] // Output of the above example in PHP 8.2 is similar to: // [result] // . // .. // apple.jpg // banana.jpg // example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.key.php // ========== FILESYSTEMITERATOR_KEY - END // SYNTAX: // string FilesystemIterator::key() return $return_filesystemiterator_key; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to the next file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_next($filesystemiterator) { // ========== FILESYSTEMITERATOR_NEXT - BEGIN // ===== ABOUT // Move to the next file // ===== DESCRIPTION // Move to the next file. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::next(): void // ===== CODE $filesystemiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 FilesystemIterator::next() example // List the contents of a directory using a while loop. // [php] // $iterator = new FilesystemIterator(dirname(__FILE__)); // while($iterator->valid()) { // echo $iterator->getFilename() . "\n"; // $iterator->next(); // } // [/php] // The above example will output something similar to: // [result] // apple.jpg // banana.jpg // example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.next.php // ========== FILESYSTEMITERATOR_NEXT - END // SYNTAX: // void FilesystemIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewinds back to the beginning. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_rewind($filesystemiterator) { // ========== FILESYSTEMITERATOR_REWIND - BEGIN // ===== ABOUT // Rewinds back to the beginning // ===== DESCRIPTION // Rewinds the directory back to the start. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::rewind(): void // ===== CODE $filesystemiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 FilesystemIterator::rewind() example // [php] // $iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_FILENAME); // // echo $iterator->key() . "\n"; // // $iterator->next(); // echo $iterator->key() . "\n"; // // $iterator->rewind(); // echo $iterator->key() . "\n"; // [/php] // The above example will output something similar to: // [result] // apple.jpg // banana.jpg // apple.jpg // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.rewind.php // ========== FILESYSTEMITERATOR_REWIND - END // SYNTAX: // void FilesystemIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets handling flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilesystemIterator::setFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filesystemiterator_setflags($filesystemiterator, $flags) { // ========== FILESYSTEMITERATOR_SETFLAGS - BEGIN // ===== ABOUT // Sets handling flags // ===== DESCRIPTION // Sets handling flags. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public FilesystemIterator::setFlags(int $flags): void // ===== CODE $filesystemiterator->setFlags( $flags // int flags - The handling flags to set. See the FilesystemIterator constants. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 FilesystemIterator::key() example // This example demonstrates the difference between the FilesystemIterator::KEY_AS_PATHNAME and FilesystemIterator::KEY_AS_FILENAME flags. // [php] // $iterator = new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_PATHNAME); // echo "Key as Pathname:\n"; // foreach ($iterator as $key => $fileinfo) { // echo $key . "\n"; // } // // $iterator->setFlags(FilesystemIterator::KEY_AS_FILENAME); // echo "\nKey as Filename:\n"; // foreach ($iterator as $key => $fileinfo) { // echo $key . "\n"; // } // [/php] // Output of the above example in PHP 8.2 is similar to: // [result] // Key as Pathname: // /www/examples/. // /www/examples/.. // /www/examples/apple.jpg // /www/examples/banana.jpg // /www/examples/example.php // // Key as Filename: // . // .. // apple.jpg // banana.jpg // example.php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filesystemiterator.setflags.php // ========== FILESYSTEMITERATOR_SETFLAGS - END // SYNTAX: // void FilesystemIterator::setFlags(int $flags) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR_SETFLAGS // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_FILESYSTEMITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_ACCEPT - bool php_basic_spl_iterators_filteriterator_accept(FilterIterator $filteriterator) // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_CONSTRUCT - FilterIterator php_basic_spl_iterators_filteriterator_construct(Iterator $iterator) // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_CURRENT - mixed php_basic_spl_iterators_filteriterator_current(FilterIterator $filteriterator) // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_KEY - mixed php_basic_spl_iterators_filteriterator_key(FilterIterator $filteriterator) // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_NEXT - void php_basic_spl_iterators_filteriterator_next(FilterIterator $filteriterator) // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_REWIND - void php_basic_spl_iterators_filteriterator_rewind(FilterIterator $filteriterator) // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_VALID - bool php_basic_spl_iterators_filteriterator_valid(FilterIterator $filteriterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (7) // FilterIterator::accept() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilterIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilterIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilterIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilterIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilterIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // FilterIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // bool // FilterIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // mixed // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_ACCEPT // ============================== PUBLIC // ============================== ABOUT // Check whether the current element of the iterator is acceptable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::accept() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_accept($filteriterator) { $return_filteriterator_accept = false; // ========== FILTERITERATOR_ACCEPT - BEGIN // ===== ABOUT // Check whether the current element of the iterator is acceptable // ===== DESCRIPTION // Returns whether the current element of the iterator is acceptable through this filter. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::accept(): bool // ===== CODE $return_filteriterator_accept = $filteriterator->accept( // This function has no parameters. ); // Return Values // true if the current element is acceptable, otherwise false. // // [examples] // Examples // [example] // Example #1 FilterIterator::accept() example // [php] // // This iterator filters all values with less than 10 characters // class LengthFilterIterator extends FilterIterator { // // public function accept() { // // Only accept strings with a length of 10 and greater // return strlen(parent::current()) >= 10; // } // // } // // $arrayIterator = new ArrayIterator(array('test1', 'more than 10 characters')); // $lengthFilter = new LengthFilterIterator($arrayIterator); // // foreach ($lengthFilter as $value) { // echo $value . "\n"; // } // [/php] // The above example will output: // [result] // more than 10 characters // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.accept.php // ========== FILTERITERATOR_ACCEPT - END // SYNTAX: // bool FilterIterator::accept() return $return_filteriterator_accept; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_ACCEPT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a filterIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_construct($iterator) { $return_filteriterator_construct = null; // ========== FILTERITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a filterIterator // ===== DESCRIPTION // Constructs a new FilterIterator, which consists of a passed in iterator with filters applied to it. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::__construct(Iterator $iterator) // ===== CODE $return_filteriterator_construct = new FilterIterator( $iterator // Iterator iterator - The iterator that is being filtered. ); // Return // FilterIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.construct.php // ========== FILTERITERATOR_CONSTRUCT - END // SYNTAX: // FilterIterator FilterIterator::__construct(Iterator $iterator) return $return_filteriterator_construct; // FilterIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Get the current element value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_current($filteriterator) { $return_filteriterator_current = null; // ========== FILTERITERATOR_CURRENT - BEGIN // ===== ABOUT // Get the current element value // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Get the current element value. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::current(): mixed // ===== CODE $return_filteriterator_current = $filteriterator->current( // This function has no parameters. ); // Return Values // The current element value. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.current.php // ========== FILTERITERATOR_CURRENT - END // SYNTAX: // mixed FilterIterator::current() return $return_filteriterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Get the current key. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_key($filteriterator) { $return_filteriterator_key = null; // ========== FILTERITERATOR_KEY - BEGIN // ===== ABOUT // Get the current key // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Get the current key. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::key(): mixed // ===== CODE $return_filteriterator_key = $filteriterator->key( // This function has no parameters. ); // Return Values // The current key. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.key.php // ========== FILTERITERATOR_KEY - END // SYNTAX: // mixed FilterIterator::key() return $return_filteriterator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move the iterator forward. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_next($filteriterator) { // ========== FILTERITERATOR_NEXT - BEGIN // ===== ABOUT // Move the iterator forward // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Move the iterator forward. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::next(): void // ===== CODE $filteriterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.next.php // ========== FILTERITERATOR_NEXT - END // SYNTAX: // void FilterIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_rewind($filteriterator) { // ========== FILTERITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind the iterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Rewind the iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::rewind(): void // ===== CODE $filteriterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.rewind.php // ========== FILTERITERATOR_REWIND - END // SYNTAX: // void FilterIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the current element is valid. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // FilterIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_filteriterator_valid($filteriterator) { $return_filteriterator_valid = false; // ========== FILTERITERATOR_VALID - BEGIN // ===== ABOUT // Check whether the current element is valid // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // Checks whether the current element is valid. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public FilterIterator::valid(): bool // ===== CODE $return_filteriterator_valid = $filteriterator->valid( // This function has no parameters. ); // Return Values // true if the current element is valid, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/filteriterator.valid.php // ========== FILTERITERATOR_VALID - END // SYNTAX: // bool FilterIterator::valid() return $return_filteriterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_FILTERITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR_CONSTRUCT - GlobIterator php_basic_spl_iterators_globiterator_construct(string $pattern, int $flags) // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR_COUNT - int php_basic_spl_iterators_globiterator_count(GlobIterator $globiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // GlobIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // GlobIterator::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // GlobIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // string // int // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a directory using glob. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // GlobIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_globiterator_construct($pattern, $flags) { $return_globiterator_construct = null; // ========== GLOBITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a directory using glob // ===== DESCRIPTION // Constructs a new directory iterator from a glob expression. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public GlobIterator::__construct(string $pattern, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO) // ===== CODE $return_globiterator_construct = new GlobIterator( $pattern, // string pattern - A glob() pattern. $flags // int flags - Option flags, the flags may be a bitmask of the FilesystemIterator constants. ); // Return // GlobIterator // // Errors/Exceptions // Throws an UnexpectedValueException if the directory does not exist. // Throws a ValueError if the directory is an empty string. // // Changelog // Version - Description // 8.0.0 - Now throws a ValueError if directory is an empty string; previously it threw a RuntimeException. // // [examples] // Examples // [example] // Example #1 GlobIterator example // [php] // $iterator = new GlobIterator('*.dll', FilesystemIterator::KEY_AS_FILENAME); // // if (!$iterator->count()) { // echo 'No matches'; // } else { // $n = 0; // // printf("Matched %d item(s)\r\n", $iterator->count()); // // foreach ($iterator as $item) { // printf("[%d] %s\r\n", ++$n, $iterator->key()); // } // } // [/php] // The above example will output something similar to: // [result] // Matched 2 item(s) // [1] php5ts.dll // [2] php_gd2.dll // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/globiterator.construct.php // ========== GLOBITERATOR_CONSTRUCT - END // SYNTAX: // GlobIterator GlobIterator::__construct(string $pattern, int $flags) return $return_globiterator_construct; // GlobIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR_COUNT // ============================== PUBLIC // ============================== ABOUT // Get the number of directories and files. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // GlobIterator::count() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_globiterator_count($globiterator) { $return_globiterator_count = 0; // ========== GLOBITERATOR_COUNT - BEGIN // ===== ABOUT // Get the number of directories and files // ===== DESCRIPTION // Gets the number of directories and files found by the glob expression. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public GlobIterator::count(): int // ===== CODE $return_globiterator_count = $globiterator->count( // This function has no parameters. ); // Return Values // The number of returned directories and files, as an int. // // [examples] // Examples // [example] // Example #1 GlobIterator::count() example // [php] // $iterator = new GlobIterator('*.xml'); // // printf("Matched %d item(s)\r\n", $iterator->count()); // [/php] // The above example will output something similar to: // [result] // Matched 8 item(s) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://php.net/manual/en/globiterator.count.php // ========== GLOBITERATOR_COUNT - END // SYNTAX: // int GlobIterator::count() return $return_globiterator_count; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR_COUNT // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_GLOBITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR_CONSTRUCT - InfiniteIterator php_basic_spl_iterators_infiniteiterator_construct(Iterator $iterator) // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR_NEXT - void php_basic_spl_iterators_infiniteiterator_next(InfiniteIterator $infiniteiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // InfiniteIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // InfiniteIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // InfiniteIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs an InfiniteIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // InfiniteIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_infiniteiterator_construct($iterator) { $return_infiniteiterator_construct = null; // ========== INFINITEITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs an InfiniteIterator // ===== DESCRIPTION // Constructs an InfiniteIterator from an Iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public InfiniteIterator::__construct(Iterator $iterator) // ===== CODE $return_infiniteiterator_construct = new InfiniteIterator( $iterator // Iterator iterator - The iterator to infinitely iterate over. ); // Return // InfiniteIterator // // [examples] // Examples // [example] // Example #1 InfiniteIterator::__construct() example // [php] // $arrayit = new ArrayIterator(array('cat','dog')); // $infinite = new InfiniteIterator($arrayit); // $limit = new LimitIterator($infinite, 0, 7); // foreach($limit as $value) // { // echo "$value\n"; // } // [/php] // The above example will output: // [result] // cat // dog // cat // dog // cat // dog // cat // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/infiniteiterator.construct.php // ========== INFINITEITERATOR_CONSTRUCT - END // SYNTAX: // InfiniteIterator InfiniteIterator::__construct(Iterator $iterator) return $return_infiniteiterator_construct; // InfiniteIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Moves the inner Iterator forward or rewinds it. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // InfiniteIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_infiniteiterator_next($infiniteiterator) { // ========== INFINITEITERATOR_NEXT - BEGIN // ===== ABOUT // Moves the inner Iterator forward or rewinds it // ===== DESCRIPTION // Moves the inner Iterator forward to its next element if there is one, otherwise rewinds the inner Iterator back to the beginning. // Note: Even an InfiniteIterator stops if its inner Iterator is empty. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public InfiniteIterator::next(): void // ===== CODE $infiniteiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/infiniteiterator.next.php // ========== INFINITEITERATOR_NEXT - END // SYNTAX: // void InfiniteIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR_NEXT // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_INFINITEITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_CONSTRUCT - IteratorIterator php_basic_spl_iterators_iteratoriterator_construct(Traversable $iterator, string $class = null) // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_CURRENT - mixed php_basic_spl_iterators_iteratoriterator_current(IteratorIterator $iteratoriterator) // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_GETINNERITERATOR - Iterator php_basic_spl_iterators_iteratoriterator_getinneriterator(IteratorIterator $iteratoriterator) // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_KEY - mixed php_basic_spl_iterators_iteratoriterator_key(IteratorIterator $iteratoriterator) // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_NEXT - void php_basic_spl_iterators_iteratoriterator_next(IteratorIterator $iteratoriterator) // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_REWIND - void php_basic_spl_iterators_iteratoriterator_rewind(IteratorIterator $iteratoriterator) // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_VALID - bool php_basic_spl_iterators_iteratoriterator_valid(IteratorIterator $iteratoriterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (7) // IteratorIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator::getInnerIterator() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // IteratorIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (7) // IteratorIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Traversable - PHP_5, PHP_7, PHP_8 // string // mixed // Iterator - PHP_5, PHP_7, PHP_8 // void // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Create an iterator from anything that is traversable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_construct($iterator, $class = null) { $return_iteratoriterator_construct = null; // ========== ITERATORITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Create an iterator from anything that is traversable // ===== DESCRIPTION // Creates an iterator from anything that is traversable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::__construct(Traversable $iterator, ?string $class = null) // ===== CODE $return_iteratoriterator_construct = new IteratorIterator( $iterator, // Traversable iterator - The traversable iterator. $class // string class - The class name to use for the inner iterator. It allows to specify a different iterator class to wrap the provided iterator. By default, it will use the IteratorIterator class itself. ); // Return // IteratorIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.construct.php // ========== ITERATORITERATOR_CONSTRUCT - END // SYNTAX: // IteratorIterator IteratorIterator::__construct(Traversable $iterator, string $class = null) return $return_iteratoriterator_construct; // IteratorIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Get the current value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_current($iteratoriterator) { $return_iteratoriterator_current = null; // ========== ITERATORITERATOR_CURRENT - BEGIN // ===== ABOUT // Get the current value // ===== DESCRIPTION // Get the value of the current element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::current(): mixed // ===== CODE $return_iteratoriterator_current = $iteratoriterator->current( // This function has no parameters. ); // Return Values // The value of the current element. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.current.php // ========== ITERATORITERATOR_CURRENT - END // SYNTAX: // mixed IteratorIterator::current() return $return_iteratoriterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_GETINNERITERATOR // ============================== PUBLIC // ============================== ABOUT // Get the inner iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::getInnerIterator() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_getinneriterator($iteratoriterator) { $return_iteratoriterator_getinneriterator = null; // ========== ITERATORITERATOR_GETINNERITERATOR - BEGIN // ===== ABOUT // Get the inner iterator // ===== DESCRIPTION // Get the inner iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::getInnerIterator(): ?Iterator // ===== CODE $return_iteratoriterator_getinneriterator = $iteratoriterator->getInnerIterator( // This function has no parameters. ); // Return Values // The inner iterator as passed to IteratorIterator::__construct(), or null when there is no inner iterator. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.getinneriterator.php // ========== ITERATORITERATOR_GETINNERITERATOR - END // SYNTAX: // Iterator IteratorIterator::getInnerIterator() return $return_iteratoriterator_getinneriterator; // Iterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_GETINNERITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Get the key of the current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_key($iteratoriterator) { $return_iteratoriterator_key = null; // ========== ITERATORITERATOR_KEY - BEGIN // ===== ABOUT // Get the key of the current element // ===== DESCRIPTION // Get the key of the current element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::key(): mixed // ===== CODE $return_iteratoriterator_key = $iteratoriterator->key( // This function has no parameters. ); // Return Values // The key of the current element. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.key.php // ========== ITERATORITERATOR_KEY - END // SYNTAX: // mixed IteratorIterator::key() return $return_iteratoriterator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Forward to the next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_next($iteratoriterator) { // ========== ITERATORITERATOR_NEXT - BEGIN // ===== ABOUT // Forward to the next element // ===== DESCRIPTION // Forward to the next element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::next(): void // ===== CODE $iteratoriterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.next.php // ========== ITERATORITERATOR_NEXT - END // SYNTAX: // void IteratorIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind to the first element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_rewind($iteratoriterator) { // ========== ITERATORITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind to the first element // ===== DESCRIPTION // Rewinds to the first element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::rewind(): void // ===== CODE $iteratoriterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.rewind.php // ========== ITERATORITERATOR_REWIND - END // SYNTAX: // void IteratorIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Checks if the iterator is valid. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // IteratorIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_iteratoriterator_valid($iteratoriterator) { $return_iteratoriterator_valid = false; // ========== ITERATORITERATOR_VALID - BEGIN // ===== ABOUT // Checks if the iterator is valid // ===== DESCRIPTION // Checks if the iterator is valid. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public IteratorIterator::valid(): bool // ===== CODE $return_iteratoriterator_valid = $iteratoriterator->valid( // This function has no parameters. ); // Return Values // Returns true if the iterator is valid, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/iteratoriterator.valid.php // ========== ITERATORITERATOR_VALID - END // SYNTAX: // bool IteratorIterator::valid() return $return_iteratoriterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_ITERATORITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_CONSTRUCT - LimitIterator php_basic_spl_iterators_limititerator_construct(Iterator $iterator, int $offset = 0, int $limit = -1) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_CURRENT - mixed php_basic_spl_iterators_limititerator_current(LimitIterator $limititerator) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_GETPOSITION - int php_basic_spl_iterators_limititerator_getposition(LimitIterator $limititerator) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_KEY - mixed php_basic_spl_iterators_limititerator_key(LimitIterator $limititerator) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_NEXT - void php_basic_spl_iterators_limititerator_next(LimitIterator $limititerator) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_REWIND - void php_basic_spl_iterators_limititerator_rewind(LimitIterator $limititerator) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_SEEK - int php_basic_spl_iterators_limititerator_seek(LimitIterator $limititerator, int $offset) // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_VALID - bool php_basic_spl_iterators_limititerator_valid(LimitIterator $limititerator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (8) // LimitIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::getPosition() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::seek() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // LimitIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (6) // LimitIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // int // mixed // void // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a LimitIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_construct($iterator, $offset = 0, $limit = -1) { $return_limititerator_construct = null; // ========== LIMITITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a LimitIterator // ===== DESCRIPTION // Constructs a new LimitIterator from an iterator with a given starting offset and maximum limit. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::__construct(Iterator $iterator, int $offset = 0, int $limit = -1) // ===== CODE $return_limititerator_construct = new LimitIterator( $iterator, // Iterator iterator - The Iterator to limit. $offset, // int offset - Optional offset of the limit. $limit // int limit - Optional count of the limit. ); // Return // LimitIterator // // Errors/Exceptions // Throws a ValueError if the offset is less than 0 or the limit is less than -1. // // Changelog // Version - Description // 8.0.0 - Now throws a ValueError if offset is less than 0; previously it threw a RuntimeException. // 8.0.0 - Now throws a ValueError if limit is less than -1; previously it threw a RuntimeException. // // [examples] // Examples // [example] // Example #1 LimitIterator::__construct() example // [php] // $ait = new ArrayIterator(array('a', 'b', 'c', 'd', 'e')); // $lit = new LimitIterator($ait, 1, 3); // foreach ($lit as $value) { // echo $value . "\n"; // } // [/php] // The above example will output: // [result] // b // c // d // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.construct.php // ========== LIMITITERATOR_CONSTRUCT - END // SYNTAX: // LimitIterator LimitIterator::__construct(Iterator $iterator, int $offset = 0, int $limit = -1) return $return_limititerator_construct; // LimitIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Get current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_current($limititerator) { $return_limititerator_current = null; // ========== LIMITITERATOR_CURRENT - BEGIN // ===== ABOUT // Get current element // ===== DESCRIPTION // Gets the current element of the inner Iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::current(): mixed // ===== CODE $return_limititerator_current = $limititerator->current( // This function has no parameters. ); // Return Values // Returns the current element or null if there is none. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.current.php // ========== LIMITITERATOR_CURRENT - END // SYNTAX: // mixed LimitIterator::current() return $return_limititerator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_GETPOSITION // ============================== PUBLIC // ============================== ABOUT // Return the current position. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::getPosition() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_getposition($limititerator) { $return_limititerator_getposition = 0; // ========== LIMITITERATOR_GETPOSITION - BEGIN // ===== ABOUT // Return the current position // ===== DESCRIPTION // Gets the current zero-based position of the inner Iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::getPosition(): int // ===== CODE $return_limititerator_getposition = $limititerator->getPosition( // This function has no parameters. ); // Return Values // The current position. // // [examples] // Examples // [example] // Example #1 LimitIterator::getPosition() example // [php] // $fruits = array( // 'a' => 'apple', // 'b' => 'banana', // 'c' => 'cherry', // 'd' => 'damson', // 'e' => 'elderberry' // ); // $array_it = new ArrayIterator($fruits); // $limit_it = new LimitIterator($array_it, 2, 3); // foreach ($limit_it as $item) { // echo $limit_it->getPosition() . ' ' . $item . "\n"; // } // [/php] // The above example will output: // [result] // 2 cherry // 3 damson // 4 elderberry // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.getposition.php // ========== LIMITITERATOR_GETPOSITION - END // SYNTAX: // int LimitIterator::getPosition() return $return_limititerator_getposition; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_GETPOSITION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Get current key // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_key($limititerator) { $return_limititerator_key = null; // ========== LIMITITERATOR_KEY - BEGIN // ===== ABOUT // Get current key // ===== DESCRIPTION // Gets the key for the current item in the inner Iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::key(): mixed // ===== CODE $return_limititerator_key = $limititerator->key( // This function has no parameters. ); // Return Values // Returns the key for the current item. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.key.php // ========== LIMITITERATOR_KEY - END // SYNTAX: // mixed LimitIterator::key() return $return_limititerator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move the iterator forward. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_next($limititerator) { // ========== LIMITITERATOR_NEXT - BEGIN // ===== ABOUT // Move the iterator forward // ===== DESCRIPTION // Moves the iterator forward. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::next(): void // ===== CODE $limititerator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.next.php // ========== LIMITITERATOR_NEXT - END // SYNTAX: // void LimitIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the iterator to the specified starting offset. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_rewind($limititerator) { // ========== LIMITITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind the iterator to the specified starting offset // ===== DESCRIPTION // Rewinds the iterator to the starting offset specified in LimitIterator::__construct(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::rewind(): void // ===== CODE $limititerator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.rewind.php // ========== LIMITITERATOR_REWIND - END // SYNTAX: // void LimitIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_SEEK // ============================== PUBLIC // ============================== ABOUT // Seek to the given position. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::seek() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_seek($limititerator, $offset) { $return_limititerator_seek = 0; // ========== LIMITITERATOR_SEEK - BEGIN // ===== ABOUT // Seek to the given position // ===== DESCRIPTION // Moves the iterator to the offset specified by offset. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::seek(int $offset): int // ===== CODE $return_limititerator_seek = $limititerator->seek( $offset // int offset - The position to seek to. ); // Return Values // Returns the offset position after seeking. // // Errors/Exceptions // Throws an OutOfBoundsException if the position is outside of the limits specified in LimitIterator::__construct(). // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.seek.php // ========== LIMITITERATOR_SEEK - END // SYNTAX: // int LimitIterator::seek(int $offset) return $return_limititerator_seek; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_SEEK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the current element is valid. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // LimitIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_limititerator_valid($limititerator) { $return_limititerator_valid = false; // ========== LIMITITERATOR_VALID - BEGIN // ===== ABOUT // Check whether the current element is valid // ===== DESCRIPTION // Checks whether the current element is valid. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public LimitIterator::valid(): bool // ===== CODE $return_limititerator_valid = $limititerator->valid( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/limititerator.valid.php // ========== LIMITITERATOR_VALID - END // SYNTAX: // bool LimitIterator::valid() return $return_limititerator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_LIMITITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_ATTACHITERATOR - void php_basic_spl_iterators_multipleiterator_attachiterator(MultipleIterator $multipleiterator, Iterator $iterator, string|int|null $info = null) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CONSTRUCT - MultipleIterator php_basic_spl_iterators_multipleiterator_construct(int $flags) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CONTAINSITERATOR - bool php_basic_spl_iterators_multipleiterator_containsiterator(MultipleIterator $multipleiterator, Iterator $iterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_COUNTITERATORS - int php_basic_spl_iterators_multipleiterator_countiterators(MultipleIterator $multipleiterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CURRENT - array php_basic_spl_iterators_multipleiterator_current(MultipleIterator $multipleiterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_DETACHITERATOR - void php_basic_spl_iterators_multipleiterator_detachiterator(MultipleIterator $multipleiterator, Iterator $iterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_GETFLAGS - int php_basic_spl_iterators_multipleiterator_getflags(MultipleIterator $multipleiterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_KEY - array php_basic_spl_iterators_multipleiterator_key(MultipleIterator $multipleiterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_NEXT - void php_basic_spl_iterators_multipleiterator_next(MultipleIterator $multipleiterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_REWIND - void php_basic_spl_iterators_multipleiterator_rewind(MultipleIterator $multipleiterator) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_SETFLAGS - void php_basic_spl_iterators_multipleiterator_setflags(MultipleIterator $multipleiterator, int $flags) // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_VALID - bool php_basic_spl_iterators_multipleiterator_valid(MultipleIterator $multipleiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (12) // MultipleIterator::attachIterator() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::containsIterator() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::countIterators() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::detachIterator() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::getFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::setFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // MultipleIterator::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (8) // void // MultipleIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // string // int // null // bool // array // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_ATTACHITERATOR // ============================== PUBLIC // ============================== ABOUT // Attaches iterator information. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::attachIterator() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_attachiterator($multipleiterator, $iterator, $info = null) { // ========== MULTIPLEITERATOR_ATTACHITERATOR - BEGIN // ===== ABOUT // Attaches iterator information // ===== DESCRIPTION // Attaches iterator information. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::attachIterator(Iterator $iterator, string|int|null $info = null): void // ===== CODE $multipleiterator->attachIterator( $iterator, // Iterator iterator - The new iterator to attach. $info // string|int|null info - The associative information for the Iterator, which must be an int, a string, or null. ); // Return Values // Description... // // Errors/Exceptions // An IllegalValueException if the iterator parameter is invalid, or if info is already associated information. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.attachiterator.php // ========== MULTIPLEITERATOR_ATTACHITERATOR - END // SYNTAX: // void MultipleIterator::attachIterator(Iterator $iterator, string|int|null $info = null) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_ATTACHITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a new MultipleIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_construct($flags) { $return_multipleiterator_construct = null; // ========== MULTIPLEITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a new MultipleIterator // ===== DESCRIPTION // Construct a new MultipleIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::__construct(int $flags = MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC) // ===== CODE $return_multipleiterator_construct = new MultipleIterator( $flags // int flags - The flags to set, according to the Flag Constants. // * MultipleIterator::MIT_NEED_ALL or MultipleIterator::MIT_NEED_ANY // * MultipleIterator::MIT_KEYS_NUMERIC or MultipleIterator::MIT_KEYS_ASSOC // Defaults to MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC. ); // Return // MultipleIterator // // [examples] // Examples // [example] // Example #1 Iterating a MultipleIterator // [php] // $people = new ArrayIterator(array('John', 'Jane', 'Jack', 'Judy')); // $roles = new ArrayIterator(array('Developer', 'Scrum Master', 'Project Owner')); // // $team = new MultipleIterator($flags); // $team->attachIterator($people, 'person'); // $team->attachIterator($roles, 'role'); // // foreach ($team as $member) { // print_r($member); // } // [/php] // Output with $flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC // [result] // Array // ( // [0] => John // [1] => Developer // ) // Array // ( // [0] => Jane // [1] => Scrum Master // ) // Array // ( // [0] => Jack // [1] => Project Owner // ) // [/result] // Output with $flags = MIT_NEED_ANY|MIT_KEYS_NUMERIC // [result] // Array // ( // [0] => John // [1] => Developer // ) // Array // ( // [0] => Jane // [1] => Scrum Master // ) // Array // ( // [0] => Jack // [1] => Project Owner // ) // Array // ( // [0] => Judy // [1] => // ) // [/result] // Output with $flags = MIT_NEED_ALL|MIT_KEYS_ASSOC // [result] // Array // ( // [person] => John // [role] => Developer // ) // Array // ( // [person] => Jane // [role] => Scrum Master // ) // Array // ( // [person] => Jack // [role] => Project Owner // ) // [/result] // Output with $flags = MIT_NEED_ANY|MIT_KEYS_ASSOC // [result] // Array // ( // [person] => John // [role] => Developer // ) // Array // ( // [person] => Jane // [role] => Scrum Master // ) // Array // ( // [person] => Jack // [role] => Project Owner // ) // Array // ( // [person] => Judy // [role] => // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.construct.php // ========== MULTIPLEITERATOR_CONSTRUCT - END // SYNTAX: // MultipleIterator MultipleIterator::__construct(int $flags) return $return_multipleiterator_construct; // MultipleIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CONTAINSITERATOR // ============================== PUBLIC // ============================== ABOUT // Checks if an iterator is attached. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::containsIterator() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_containsiterator($multipleiterator, $iterator) { $return_multipleiterator_containsiterator = false; // ========== MULTIPLEITERATOR_CONTAINSITERATOR - BEGIN // ===== ABOUT // Checks if an iterator is attached // ===== DESCRIPTION // Checks if an iterator is attached or not. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::containsIterator(Iterator $iterator): bool // ===== CODE $return_multipleiterator_containsiterator = $multipleiterator->containsIterator( $iterator // Iterator iterator - The iterator to check. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.containsiterator.php // ========== MULTIPLEITERATOR_CONTAINSITERATOR - END // SYNTAX: // bool MultipleIterator::containsIterator(Iterator $iterator) return $return_multipleiterator_containsiterator; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CONTAINSITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_COUNTITERATORS // ============================== PUBLIC // ============================== ABOUT // Gets the number of attached iterator instances. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::countIterators() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_countiterators($multipleiterator) { $return_multipleiterator_countiterators = 0; // ========== MULTIPLEITERATOR_COUNTITERATORS - BEGIN // ===== ABOUT // Gets the number of attached iterator instances // ===== DESCRIPTION // Gets the number of attached iterator instances. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::countIterators(): int // ===== CODE $return_multipleiterator_countiterators = $multipleiterator->countIterators( // This function has no parameters. ); // Return Values // The number of attached iterator instances (as an int). // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.countiterators.php // ========== MULTIPLEITERATOR_COUNTITERATORS - END // SYNTAX: // int MultipleIterator::countIterators() return $return_multipleiterator_countiterators; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_COUNTITERATORS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Gets the registered iterator instances. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_current($multipleiterator) { $return_multipleiterator_current = null; // ========== MULTIPLEITERATOR_CURRENT - BEGIN // ===== ABOUT // Gets the registered iterator instances // ===== DESCRIPTION // Get the registered iterator instances current() result. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::current(): array // ===== CODE $return_multipleiterator_current = $multipleiterator->current( // This function has no parameters. ); // Return Values // An array containing the current values of each attached iterator. // // Errors/Exceptions // A RuntimeException if the iterator is invalid (as of PHP 8.1.0), or mode MIT_NEED_ALL is set and at least one attached iterator is not valid. Or an IllegalValueException if a key is null and MIT_KEYS_ASSOC is set. // // Changelog // Version - Description // 8.1.0 - A RuntimeException is now thrown if MultipleIterator::current() is called on an invalid iterator. Previously, false was returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.current.php // ========== MULTIPLEITERATOR_CURRENT - END // SYNTAX: // array MultipleIterator::current() return $return_multipleiterator_current; // array } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_DETACHITERATOR // ============================== PUBLIC // ============================== ABOUT // Detaches an iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::detachIterator() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_detachiterator($multipleiterator, $iterator) { // ========== MULTIPLEITERATOR_DETACHITERATOR - BEGIN // ===== ABOUT // Detaches an iterator // ===== DESCRIPTION // Detaches an iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::detachIterator(Iterator $iterator): void // ===== CODE $multipleiterator->detachIterator( $iterator // Iterator iterator - The iterator to detach. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.detachiterator.php // ========== MULTIPLEITERATOR_DETACHITERATOR - END // SYNTAX: // void MultipleIterator::detachIterator(Iterator $iterator) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_DETACHITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Gets the flag information. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::getFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_getflags($multipleiterator) { $return_multipleiterator_getflags = 0; // ========== MULTIPLEITERATOR_GETFLAGS - BEGIN // ===== ABOUT // Gets the flag information // ===== DESCRIPTION // Gets information about the flags. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::getFlags(): int // ===== CODE $return_multipleiterator_getflags = $multipleiterator->getFlags( // This function has no parameters. ); // Return Values // Information about the flags, as an int. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.getflags.php // ========== MULTIPLEITERATOR_GETFLAGS - END // SYNTAX: // int MultipleIterator::getFlags() return $return_multipleiterator_getflags; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Gets the registered iterator instances. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_key($multipleiterator) { $return_multipleiterator_key = null; // ========== MULTIPLEITERATOR_KEY - BEGIN // ===== ABOUT // Gets the registered iterator instances // ===== DESCRIPTION // Get the registered iterator instances key() result. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::key(): array // ===== CODE $return_multipleiterator_key = $multipleiterator->key( // This function has no parameters. ); // Return Values // An array of all registered iterator instances. // // Errors/Exceptions // A RuntimeException if the iterator is invalid (as of PHP 8.1.0), or mode MIT_NEED_ALL is set, and at least one attached iterator is not valid. // Calling this method from foreach triggers warning "Illegal type returned". // // Changelog // Version - Description // 8.1.0 - A RuntimeException is now thrown if MultipleIterator::key() is called on an invalid iterator. Previously, false was returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.key.php // ========== MULTIPLEITERATOR_KEY - END // SYNTAX: // array MultipleIterator::key() return $return_multipleiterator_key; // array } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Moves all attached iterator instances forward. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_next($multipleiterator) { // ========== MULTIPLEITERATOR_NEXT - BEGIN // ===== ABOUT // Moves all attached iterator instances forward // ===== DESCRIPTION // Moves all attached iterator instances forward. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::next(): void // ===== CODE $multipleiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.next.php // ========== MULTIPLEITERATOR_NEXT - END // SYNTAX: // void MultipleIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewinds all attached iterator instances. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_rewind($multipleiterator) { // ========== MULTIPLEITERATOR_REWIND - BEGIN // ===== ABOUT // Rewinds all attached iterator instances // ===== DESCRIPTION // Rewinds all attached iterator instances. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::rewind(): void // ===== CODE $multipleiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.rewind.php // ========== MULTIPLEITERATOR_REWIND - END // SYNTAX: // void MultipleIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::setFlags() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_setflags($multipleiterator, $flags) { // ========== MULTIPLEITERATOR_SETFLAGS - BEGIN // ===== ABOUT // Sets flags // ===== DESCRIPTION // Sets flags. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::setFlags(int $flags): void // ===== CODE $multipleiterator->setFlags( $flags // int flags - The flags to set, according to the Flag Constants ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.setflags.php // ========== MULTIPLEITERATOR_SETFLAGS - END // SYNTAX: // void MultipleIterator::setFlags(int $flags) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_SETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Checks the validity of sub iterators. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // MultipleIterator::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_multipleiterator_valid($multipleiterator) { $return_multipleiterator_valid = false; // ========== MULTIPLEITERATOR_VALID - BEGIN // ===== ABOUT // Checks the validity of sub iterators // ===== DESCRIPTION // Checks the validity of sub iterators. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public MultipleIterator::valid(): bool // ===== CODE $return_multipleiterator_valid = $multipleiterator->valid( // This function has no parameters. ); // Return Values // Returns true if one or all sub iterators are valid depending on flags, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/multipleiterator.valid.php // ========== MULTIPLEITERATOR_VALID - END // SYNTAX: // bool MultipleIterator::valid() return $return_multipleiterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_MULTIPLEITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_CONSTRUCT - NoRewindIterator php_basic_spl_iterators_norewinditerator_construct(Iterator $iterator) // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_CURRENT - mixed php_basic_spl_iterators_norewinditerator_current(NoRewindIterator $norewinditerator) // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_KEY - mixed php_basic_spl_iterators_norewinditerator_key(NoRewindIterator $norewinditerator) // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_NEXT - void php_basic_spl_iterators_norewinditerator_next(NoRewindIterator $norewinditerator) // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_REWIND - void php_basic_spl_iterators_norewinditerator_rewind(NoRewindIterator $norewinditerator) // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_VALID - bool php_basic_spl_iterators_norewinditerator_valid(NoRewindIterator $norewinditerator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (6) // NoRewindIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // NoRewindIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // NoRewindIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // NoRewindIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // NoRewindIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // NoRewindIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // NoRewindIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // mixed // void // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a NoRewindIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // NoRewindIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_norewinditerator_construct($iterator) { $return_norewinditerator_construct = null; // ========== NOREWINDITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a NoRewindIterator // ===== DESCRIPTION // Constructs a NoRewindIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public NoRewindIterator::__construct(Iterator $iterator) // ===== CODE $return_norewinditerator_construct = new NoRewindIterator( $iterator // Iterator iterator - The iterator being used. ); // Return // NoRewindIterator // // [examples] // Examples // [example] // Example #1 NoRewindIterator::__construct() example // The second loop does not output because the iterator is only used once, as it does not rewind. // [php] // $fruit = array('apple', 'banana', 'cranberry'); // // $arr = new ArrayObject($fruit); // $it = new NoRewindIterator($arr->getIterator()); // // echo "Fruit A:\n"; // foreach( $it as $item ) { // echo $item . "\n"; // } // // echo "Fruit B:\n"; // foreach( $it as $item ) { // echo $item . "\n"; // } // [/php] // The above example will output something similar to: // [result] // Fruit A: // apple // banana // cranberry // Fruit B: // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/norewinditerator.construct.php // ========== NOREWINDITERATOR_CONSTRUCT - END // SYNTAX: // NoRewindIterator NoRewindIterator::__construct(Iterator $iterator) return $return_norewinditerator_construct; // NoRewindIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Get the current value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // NoRewindIterator::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_norewinditerator_current($norewinditerator) { $return_norewinditerator_current = null; // ========== NOREWINDITERATOR_CURRENT - BEGIN // ===== ABOUT // Get the current value // ===== DESCRIPTION // Gets the current value. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public NoRewindIterator::current(): mixed // ===== CODE $return_norewinditerator_current = $norewinditerator->current( // This function has no parameters. ); // Return Values // The current value. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/norewinditerator.current.php // ========== NOREWINDITERATOR_CURRENT - END // SYNTAX: // mixed NoRewindIterator::current() return $return_norewinditerator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Get the current key. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // NoRewindIterator::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_norewinditerator_key($norewinditerator) { $return_norewinditerator_key = null; // ========== NOREWINDITERATOR_KEY - BEGIN // ===== ABOUT // Get the current key // ===== DESCRIPTION // Gets the current key. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public NoRewindIterator::key(): mixed // ===== CODE $return_norewinditerator_key = $norewinditerator->key( // This function has no parameters. ); // Return Values // The current key. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/norewinditerator.key.php // ========== NOREWINDITERATOR_KEY - END // SYNTAX: // mixed NoRewindIterator::key() return $return_norewinditerator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Forward to the next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // NoRewindIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_norewinditerator_next($norewinditerator) { // ========== NOREWINDITERATOR_NEXT - BEGIN // ===== ABOUT // Forward to the next element // ===== DESCRIPTION // Forwards to the next element. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public NoRewindIterator::next(): void // ===== CODE $norewinditerator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/norewinditerator.next.php // ========== NOREWINDITERATOR_NEXT - END // SYNTAX: // void NoRewindIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Prevents the rewind operation on the inner iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // NoRewindIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_norewinditerator_rewind($norewinditerator) { // ========== NOREWINDITERATOR_REWIND - BEGIN // ===== ABOUT // Prevents the rewind operation on the inner iterator // ===== DESCRIPTION // Prevents the rewind operation on the inner iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public NoRewindIterator::rewind(): void // ===== CODE $norewinditerator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 NoRewindIterator::rewind() example // This example demonstrates that calling rewind on a NoRewindIterator object has no effect. // [php] // $fruits = array("lemon", "orange", "apple", "pear"); // // $noRewindIterator = new NoRewindIterator(new ArrayIterator($fruits)); // // echo $noRewindIterator->current() . "\n"; // $noRewindIterator->next(); // // now rewind the iterator (nothing should happen) // $noRewindIterator->rewind(); // echo $noRewindIterator->current() . "\n"; // [/php] // The above example will output: // [result] // lemon // orange // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/norewinditerator.rewind.php // ========== NOREWINDITERATOR_REWIND - END // SYNTAX: // void NoRewindIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Validates the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // NoRewindIterator::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_norewinditerator_valid($norewinditerator) { $return_norewinditerator_valid = false; // ========== NOREWINDITERATOR_VALID - BEGIN // ===== ABOUT // Validates the iterator // ===== DESCRIPTION // Checks whether the iterator is valid. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public NoRewindIterator::valid(): bool // ===== CODE $return_norewinditerator_valid = $norewinditerator->valid( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/norewinditerator.valid.php // ========== NOREWINDITERATOR_VALID - END // SYNTAX: // bool NoRewindIterator::valid() return $return_norewinditerator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_NOREWINDITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_ACCEPT - bool php_basic_spl_iterators_parentiterator_accept(ParentIterator $parentiterator) // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_CONSTRUCT - ParentIterator php_basic_spl_iterators_parentiterator_construct(RecursiveIterator $iterator) // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_GETCHILDREN - ParentIterator php_basic_spl_iterators_parentiterator_getchildren(ParentIterator $parentiterator) // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_NEXT - void php_basic_spl_iterators_parentiterator_next(ParentIterator $parentiterator) // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_REWIND - void php_basic_spl_iterators_parentiterator_rewind(ParentIterator $parentiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (5) // ParentIterator::accept() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ParentIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ParentIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ParentIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ParentIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (4) // bool // ParentIterator - PHP_5 >= PHP_5_1_0, PHP 7, PHP 8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_ACCEPT // ============================== PUBLIC // ============================== ABOUT // Determines acceptability. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ParentIterator::accept() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_parentiterator_accept($parentiterator) { $return_parentiterator_accept = false; // ========== PARENTITERATOR_ACCEPT - BEGIN // ===== ABOUT // Determines acceptability // ===== DESCRIPTION // Determines if the current element has children. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ParentIterator::accept(): bool // ===== CODE $return_parentiterator_accept = $parentiterator->accept( // This function has no parameters. ); // Return Values // true if the current element is acceptable, otherwise false. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/parentiterator.accept.php // ========== PARENTITERATOR_ACCEPT - END // SYNTAX: // bool ParentIterator::accept() return $return_parentiterator_accept; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_ACCEPT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a ParentIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ParentIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_parentiterator_construct($iterator) { $return_parentiterator_construct = null; // ========== PARENTITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a ParentIterator // ===== DESCRIPTION // Constructs a ParentIterator on an iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ParentIterator::__construct(RecursiveIterator $iterator) // ===== CODE $return_parentiterator_construct = new RecursiveIterator( $iterator // RecursiveIterator iterator - The iterator being constructed upon. ); // Return // ParentIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/parentiterator.construct.php // ========== PARENTITERATOR_CONSTRUCT - END // SYNTAX: // ParentIterator ParentIterator::__construct(RecursiveIterator $iterator) return $return_parentiterator_construct; // ParentIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Return the inner iterator's children contained in a ParentIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ParentIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_parentiterator_getchildren($parentiterator) { $return_parentiterator_getchildren = null; // ========== PARENTITERATOR_GETCHILDREN - BEGIN // ===== ABOUT // Return the inner iterator's children contained in a ParentIterator // ===== DESCRIPTION // Get the inner iterator's children contained in a ParentIterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ParentIterator::getChildren(): ParentIterator // ===== CODE $return_parentiterator_getchildren = $parentiterator->getChildren( // This function has no parameters. ); // Return Values // An object. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/parentiterator.getchildren.php // ========== PARENTITERATOR_GETCHILDREN - END // SYNTAX: // ParentIterator ParentIterator::getChildren() return $return_parentiterator_getchildren; // ParentIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move the iterator forward. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ParentIterator::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_parentiterator_next($parentiterator) { // ========== PARENTITERATOR_NEXT - BEGIN // ===== ABOUT // Move the iterator forward // ===== DESCRIPTION // Moves the iterator forward. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ParentIterator::next(): void // ===== CODE $parentiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/parentiterator.next.php // ========== PARENTITERATOR_NEXT - END // SYNTAX: // void ParentIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ParentIterator::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_parentiterator_rewind($parentiterator) { // ========== PARENTITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind the iterator // ===== DESCRIPTION // Rewinds the iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ParentIterator::rewind(): void // ===== CODE $parentiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/parentiterator.rewind.php // ========== PARENTITERATOR_REWIND - END // SYNTAX: // void ParentIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR_REWIND // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_PARENTITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR_GETCHILDREN - RecursiveArrayIterator php_basic_spl_iterators_recursivearrayiterator_getchildren(RecursiveArrayIterator $recursivearrayiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR_HASCHILDREN - bool php_basic_spl_iterators_recursivearrayiterator_haschildren(RecursiveArrayIterator $recursivearrayiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (2) // RecursiveArrayIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveArrayIterator::hasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (2) // RecursiveArrayIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Returns an iterator for the current entry if it is an array or an object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveArrayIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivearrayiterator_getchildren($recursivearrayiterator) { $return_iterators_recursivearrayiterator = null; // ========== ITERATORS_RECURSIVEARRAYITERATOR - BEGIN // ===== ABOUT // Returns an iterator for the current entry if it is an array or an object // ===== DESCRIPTION // Returns an iterator for the current iterator entry. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveArrayIterator::getChildren(): ?RecursiveArrayIterator // ===== CODE $return_iterators_recursivearrayiterator = $recursivearrayiterator->getChildren( // This function has no parameters. ); // Return Values // An iterator for the current entry, if it is an array or object; or null on failure. // // Errors/Exceptions // An InvalidArgumentException will be thrown if the current entry does not contain an array or an object. // // [examples] // Examples // [example] // Example #1 RecursiveArrayIterator::getChildren() example // [php] // $fruits = array("a" => "lemon", "b" => "orange", array("a" => "apple", "p" => "pear")); // // $iterator = new RecursiveArrayIterator($fruits); // // while ($iterator->valid()) { // // if ($iterator->hasChildren()) { // // print all children // foreach ($iterator->getChildren() as $key => $value) { // echo $key . ' : ' . $value . "\n"; // } // } else { // echo "No children.\n"; // } // // $iterator->next(); // } // [/php] // The above example will output: // [result] // No children. // No children. // a : apple // p : pear // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivearrayiterator.getchildren.php // ========== ITERATORS_RECURSIVEARRAYITERATOR - END // SYNTAX: // RecursiveArrayIterator RecursiveArrayIterator::getChildren() return $return_iterators_recursivearrayiterator; // RecursiveArrayIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Returns whether current entry is an array or an object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveArrayIterator::hasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivearrayiterator_haschildren($recursivearrayiterator) { $return_recursivearrayiterator_haschildren = false; // ========== RECURSIVEARRAYITERATOR_HASCHILDREN - BEGIN // ===== ABOUT // Returns whether current entry is an array or an object // ===== DESCRIPTION // Returns whether current entry is an array or an object for which an iterator can be obtained via RecursiveArrayIterator::getChildren(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveArrayIterator::hasChildren(): bool // ===== CODE $return_recursivearrayiterator_haschildren = $recursivearrayiterator->hasChildren( // This function has no parameters. ); // Return Values // Returns true if the current entry is an array or an object, otherwise false is returned. // // [examples] // Examples // [example] // Example #1 RecursiveArrayIterator::hasChildren() example // [php] // $fruits = array("a" => "lemon", "b" => "orange", array("a" => "apple", "p" => "pear")); // // $iterator = new RecursiveArrayIterator($fruits); // // while ($iterator->valid()) { // // // Check if there are children // if ($iterator->hasChildren()) { // // print all children // foreach ($iterator->getChildren() as $key => $value) { // echo $key . ' : ' . $value . "\n"; // } // } else { // echo "No children.\n"; // } // // $iterator->next(); // } // [/php] // The above example will output: // [result] // No children. // No children. // a : apple // p : pear // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivearrayiterator.haschildren.php // ========== RECURSIVEARRAYITERATOR_HASCHILDREN - END // SYNTAX: // bool RecursiveArrayIterator::hasChildren() return $return_recursivearrayiterator_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR_HASCHILDREN // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEARRAYITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_CONSTRUCT - RecursiveCachingIterator php_basic_spl_iterators_recursivecachingiterator_construct(Iterator $iterator, int $flags = RecursiveCachingIterator::CALL_TOSTRING) // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_GETCHILDREN - RecursiveCachingIterator php_basic_spl_iterators_recursivecachingiterator_getchildren(RecursiveCachingIterator $recursivecachingiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_HASCHILDREN - bool php_basic_spl_iterators_recursivecachingiterator_haschildren(RecursiveCachingIterator $recursivecachingiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (3) // RecursiveCachingIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveCachingIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveCachingIterator::hasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (4) // RecursiveCachingIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // int // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveCachingIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // RecursiveCachingIterator::CALL_TOSTRING - RecursiveCachingIterator::__construct() // ============================== CODE function php_basic_spl_iterators_recursivecachingiterator_construct($iterator, $flags = RecursiveCachingIterator::CALL_TOSTRING) { $return_recursivecachingiterator_construct = null; // ========== RECURSIVECACHINGITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct // ===== DESCRIPTION // Constructs a new RecursiveCachingIterator, which consists of a passed in iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveCachingIterator::__construct(Iterator $iterator, int $flags = RecursiveCachingIterator::CALL_TOSTRING) // ===== CODE $return_recursivecachingiterator_construct = new RecursiveCachingIterator( $iterator, // Iterator iterator - The iterator being used. $flags // int flags - The flags. Use CALL_TOSTRING to call RecursiveCachingIterator::__toString() for every element (the default), and/or CATCH_GET_CHILD to catch exceptions when trying to get children. ); // Return // RecursiveCachingIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivecachingiterator.construct.php // ========== RECURSIVECACHINGITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveCachingIterator RecursiveCachingIterator::__construct(Iterator $iterator, int $flags = RecursiveCachingIterator::CALL_TOSTRING) return $return_recursivecachingiterator_construct; // RecursiveCachingIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Return the inner iterator's children as a RecursiveCachingIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveCachingIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivecachingiterator_getchildren($recursivecachingiterator) { $return_recursivecachingiterator_getchildren = null; // ========== RECURSIVECACHINGITERATOR_GETCHILDREN - BEGIN // ===== ABOUT // Return the inner iterator's children as a RecursiveCachingIterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveCachingIterator::getChildren(): ?RecursiveCachingIterator // ===== CODE $return_recursivecachingiterator_getchildren = $recursivecachingiterator->getChildren( // This function has no parameters. ); // Return Values // The inner iterator's children, as a RecursiveCachingIterator; or null if there is no children. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivecachingiterator.getchildren.php // ========== RECURSIVECACHINGITERATOR_GETCHILDREN - END // SYNTAX: // RecursiveCachingIterator RecursiveCachingIterator::getChildren() return $return_recursivecachingiterator_getchildren; // RecursiveCachingIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Check whether the current element of the inner iterator has children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveCachingIterator::hasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivecachingiterator_haschildren($recursivecachingiterator) { $return_recursivecachingiterator_haschildren = false; // ========== RECURSIVECACHINGITERATOR_HASCHILDREN - BEGIN // ===== ABOUT // Check whether the current element of the inner iterator has children // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveCachingIterator::hasChildren(): bool // ===== CODE $return_recursivecachingiterator_haschildren = $recursivecachingiterator->hasChildren( // This function has no parameters. ); // Return Values // true if the inner iterator has children, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivecachingiterator.haschildren.php // ========== RECURSIVECACHINGITERATOR_HASCHILDREN - END // SYNTAX: // bool RecursiveCachingIterator::hasChildren() return $return_recursivecachingiterator_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR_HASCHILDREN // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECACHINGITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_CONSTRUCT - RecursiveCallbackFilterIterator php_basic_spl_iterators_recursivecallbackfilteriterator_construct(RecursiveIterator $iterator, callable $callback) // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_GETCHILDREN - RecursiveCallbackFilterIterator php_basic_spl_iterators_recursivecallbackfilteriterator_getchildren(RecursiveCallbackFilterIterator $recursivecallbackfilteriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_HASCHILDREN - bool php_basic_spl_iterators_recursivecallbackfilteriterator_haschildren(RecursiveCallbackFilterIterator $recursivecallbackfilteriterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (3) // RecursiveCallbackFilterIterator::__construct() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // RecursiveCallbackFilterIterator::getChildren() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // RecursiveCallbackFilterIterator::hasChildren() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (4) // RecursiveCallbackFilterIterator - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // callable // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Create a RecursiveCallbackFilterIterator from a RecursiveIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveCallbackFilterIterator::__construct() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivecallbackfilteriterator_construct($iterator, $callback) { $return_recursivecallbackfilteriterator_construct = null; // ========== RECURSIVECALLBACKFILTERITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Create a RecursiveCallbackFilterIterator from a RecursiveIterator // ===== DESCRIPTION // Creates a filtered iterator from a RecursiveIterator using the callback to determine which items are accepted or rejected. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveCallbackFilterIterator::__construct(RecursiveIterator $iterator, callable $callback) // ===== CODE $return_recursivecallbackfilteriterator_construct = new RecursiveCallbackFilterIterator( $iterator, // RecursiveIterator iterator - The recursive iterator to be filtered. $callback // callable callback - The callback, which should return true to accept the current item or false otherwise. See Examples. // May be any valid callable value. ); // Return // RecursiveCallbackFilterIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivecallbackfilteriterator.construct.php // ========== RECURSIVECALLBACKFILTERITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveCallbackFilterIterator RecursiveCallbackFilterIterator::__construct(RecursiveIterator $iterator, callable $callback) return $return_recursivecallbackfilteriterator_construct; // RecursiveCallbackFilterIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Return the inner iterator's children contained in a RecursiveCallbackFilterIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveCallbackFilterIterator::getChildren() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivecallbackfilteriterator_getchildren($recursivecallbackfilteriterator) { $return_recursivecallbackfilteriterator_getchildren = null; // ========== RECURSIVECALLBACKFILTERITERATOR_GETCHILDREN - BEGIN // ===== ABOUT // Return the inner iterator's children contained in a RecursiveCallbackFilterIterator // ===== DESCRIPTION // Fetches the filtered children of the inner iterator. // RecursiveCallbackFilterIterator::hasChildren() should be used to determine if there are children to be fetched. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveCallbackFilterIterator::getChildren(): RecursiveCallbackFilterIterator // ===== CODE $return_recursivecallbackfilteriterator_getchildren = $recursivecallbackfilteriterator->getChildren( // This function has no parameters. ); // Return Values // Returns a RecursiveCallbackFilterIterator containing the children. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivecallbackfilteriterator.getchildren.php // ========== RECURSIVECALLBACKFILTERITERATOR_GETCHILDREN - END // SYNTAX: // RecursiveCallbackFilterIterator RecursiveCallbackFilterIterator::getChildren(): RecursiveCallbackFilterIterator return $return_recursivecallbackfilteriterator_getchildren; // RecursiveCallbackFilterIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Check whether the inner iterator's current element has children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveCallbackFilterIterator::hasChildren() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivecallbackfilteriterator_haschildren($recursivecallbackfilteriterator) { $return_recursivecallbackfilteriterator_haschildren = false; // ========== RECURSIVECALLBACKFILTERITERATOR_HASCHILDREN - BEGIN // ===== ABOUT // Check whether the inner iterator's current element has children // ===== DESCRIPTION // Returns true if the current element has children, false otherwise. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveCallbackFilterIterator::hasChildren(): bool // ===== CODE $return_recursivecallbackfilteriterator_haschildren = $recursivecallbackfilteriterator->hasChildren( // This function has no parameters. ); // Return Values // Returns true if the current element has children, false otherwise. // // [examples] // Examples // [example] // Example #1 RecursiveCallbackFilterIterator::hasChildren() basic usage // [php] // // $dir = new RecursiveDirectoryIterator(__DIR__); // // // Recursively iterate over XML files // $files = new RecursiveCallbackFilterIterator($dir, function ($current, $key, $iterator) { // // Allow recursion into directories // if ($iterator->hasChildren()) { // return TRUE; // } // // Check for XML file // if (!strcasecmp($current->getExtension(), 'xml')) { // return TRUE; // } // return FALSE; // }); // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivecallbackfilteriterator.haschildren.php // ========== RECURSIVECALLBACKFILTERITERATOR_HASCHILDREN - END // SYNTAX: // bool RecursiveCallbackFilterIterator::hasChildren() return $return_recursivecallbackfilteriterator_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR_HASCHILDREN // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVECALLBACKFILTERITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_CONSTRUCT - RecursiveDirectoryIterator php_basic_spl_iterators_recursivedirectoryiterator_construct(string $directory, int $flags) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETCHILDREN - RecursiveDirectoryIterator php_basic_spl_iterators_recursivedirectoryiterator_getchildren(RecursiveDirectoryIterator $recursivedirectoryiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETSUBPATH - string php_basic_spl_iterators_recursivedirectoryiterator_getsubpath(RecursiveDirectoryIterator $recursivedirectoryiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETSUBPATHNAME - string php_basic_spl_iterators_recursivedirectoryiterator_getsubpathname(RecursiveDirectoryIterator $recursivedirectoryiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_HASCHILDREN - bool php_basic_spl_iterators_recursivedirectoryiterator_haschildren(RecursiveDirectoryIterator $recursivedirectoryiterator, bool $allowLinks = false) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_KEY - string php_basic_spl_iterators_recursivedirectoryiterator_key(RecursiveDirectoryIterator $recursivedirectoryiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_NEXT - void php_basic_spl_iterators_recursivedirectoryiterator_next(RecursiveDirectoryIterator $recursivedirectoryiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_REWIND - void php_basic_spl_iterators_recursivedirectoryiterator_rewind(RecursiveDirectoryIterator $recursivedirectoryiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (8) // RecursiveDirectoryIterator::__construct() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // RecursiveDirectoryIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveDirectoryIterator::getSubPath() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveDirectoryIterator::getSubPathname() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveDirectoryIterator::hasChildren() - PHP_5, PHP_7, PHP_8 // RecursiveDirectoryIterator::key() - PHP_5, PHP_7, PHP_8 // RecursiveDirectoryIterator::next() - PHP_5, PHP_7, PHP_8 // RecursiveDirectoryIterator::rewind() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // RecursiveDirectoryIterator - PHP_5, PHP_7, PHP_8 // string // int // bool // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Constructs a RecursiveDirectoryIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::__construct() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_construct($directory, $flags) { $return_recursivedirectoryiterator_construct = null; // ========== RECURSIVEDIRECTORYITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Constructs a RecursiveDirectoryIterator // ===== DESCRIPTION // Constructs a RecursiveDirectoryIterator() for the provided directory. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::__construct(string $directory, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO) // ===== CODE $return_recursivedirectoryiterator_construct = new RecursiveDirectoryIterator( $directory, // string directory - The path of the directory to be iterated over. $flags // int flags - Flags may be provided which will affect the behavior of some methods. A list of the flags can found under FilesystemIterator predefined constants. They can also be set later with FilesystemIterator::setFlags(). ); // Return // RecursiveDirectoryIterator // // Errors/Exceptions // Throws an UnexpectedValueException if the directory does not exist. // Throws a ValueError if the directory is an empty string. // // Changelog // Version - Description // 8.0.0 - Now throws a ValueError if directory is an empty string; previously it threw a RuntimeException. // // [examples] // Examples // [example] // Example #1 RecursiveDirectoryIterator example // [php] // // $directory = '/tmp'; // // $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)); // // $it->rewind(); // while($it->valid()) { // // if (!$it->isDot()) { // echo 'SubPathName: ' . $it->getSubPathName() . "\n"; // echo 'SubPath: ' . $it->getSubPath() . "\n"; // echo 'Key: ' . $it->key() . "\n\n"; // } // // $it->next(); // } // // [/php] // The above example will output something similar to: // [result] // SubPathName: fruit/apple.xml // SubPath: fruit // Key: /tmp/fruit/apple.xml // // SubPathName: stuff.xml // SubPath: // Key: /tmp/stuff.xml // // SubPathName: veggies/carrot.xml // SubPath: veggies // Key: /tmp/veggies/carrot.xml // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.construct.php // ========== RECURSIVEDIRECTORYITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveDirectoryIterator RecursiveDirectoryIterator::__construct(string $directory, int $flags) return $return_recursivedirectoryiterator_construct; // RecursiveDirectoryIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Returns an iterator for the current entry if it is a directory. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_getchildren($recursivedirectoryiterator) { $return_recursivedirectoryiterator_getchildren = null; // ========== RECURSIVEDIRECTORYITERATOR_GETCHILDREN - BEGIN // ===== ABOUT // Returns an iterator for the current entry if it is a directory // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator // ===== CODE $return_recursivedirectoryiterator_getchildren = $recursivedirectoryiterator->getChildren( // This function has no parameters. ); // Return Values // The filename, file information, or $this depending on the set flags. See the FilesystemIterator constants. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.getchildren.php // ========== RECURSIVEDIRECTORYITERATOR_GETCHILDREN - END // SYNTAX: // RecursiveDirectoryIterator RecursiveDirectoryIterator::getChildren() return $return_recursivedirectoryiterator_getchildren; // RecursiveDirectoryIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETSUBPATH // ============================== PUBLIC // ============================== ABOUT // Returns the sub path relative to the directory given in the constructor. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::getSubPath() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_getsubpath($recursivedirectoryiterator) { $return_recursivedirectoryiterator_getsubpath = null; // ========== RECURSIVEDIRECTORYITERATOR_GETSUBPATH - BEGIN // ===== ABOUT // Get sub path // ===== DESCRIPTION // Returns the sub path relative to the directory given in the constructor. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::getSubPath(): string // ===== CODE $return_recursivedirectoryiterator_getsubpath = $recursivedirectoryiterator->getSubPath( // This function has no parameters. ); // Return Values // The sub path. // // [examples] // Examples // [example] // Example #1 getSubPath() example // [php] // $directory = '/tmp'; // // $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)); // // foreach ($it as $file) { // echo 'SubPathName: ' . $it->getSubPathName() . "\n"; // echo 'SubPath: ' . $it->getSubPath() . "\n\n"; // } // [/php] // The above example will output something similar to: // [result] // SubPathName: fruit/apple.xml // SubPath: fruit // // SubPathName: stuff.xml // SubPath: // // SubPathName: veggies/carrot.xml // SubPath: veggies // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.getsubpath.php // ========== RECURSIVEDIRECTORYITERATOR_GETSUBPATH - END // SYNTAX: // string RecursiveDirectoryIterator::getSubPath() return $return_recursivedirectoryiterator_getsubpath; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETSUBPATH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETSUBPATHNAME // ============================== PUBLIC // ============================== ABOUT // Get sub path and name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::getSubPathname() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_getsubpathname($recursivedirectoryiterator) { $return_recursivedirectoryiterator_getsubpathname = null; // ========== RECURSIVEDIRECTORYITERATOR_GETSUBPATHNAME - BEGIN // ===== ABOUT // Get sub path and name // ===== DESCRIPTION // Gets the sub path and filename. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::getSubPathname(): string // ===== CODE $return_recursivedirectoryiterator_getsubpathname = $recursivedirectoryiterator->getSubPathname( // This function has no parameters. ); // Return Values // The sub path (sub directory) and filename. // // [examples] // Examples // [example] // Example #1 getSubPathname() example // [php] // $directory = '/tmp'; // // $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)); // // foreach ($it as $file) { // echo 'SubPathName: ' . $it->getSubPathname() . "\n"; // echo 'SubPath: ' . $it->getSubPath() . "\n\n"; // } // [/php] // The above example will output something similar to: // [result] // SubPathName: fruit/apple.xml // SubPath: fruit // // SubPathName: stuff.xml // SubPath: // // SubPathName: veggies/carrot.xml // SubPath: veggies // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.getsubpathname.php // ========== RECURSIVEDIRECTORYITERATOR_GETSUBPATHNAME - END // SYNTAX: // string RecursiveDirectoryIterator::getSubPathname() return $return_recursivedirectoryiterator_getsubpathname; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_GETSUBPATHNAME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Returns whether current entry is a directory and not '.' or '..'. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::hasChildren() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_haschildren($recursivedirectoryiterator, $allowLinks = false) { $return_recursivedirectoryiterator_haschildren = false; // ========== RECURSIVEDIRECTORYITERATOR_HASCHILDREN - BEGIN // ===== ABOUT // Returns whether current entry is a directory and not '.' or '..' // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::hasChildren(bool $allowLinks = false): bool // ===== CODE $return_recursivedirectoryiterator_haschildren = $recursivedirectoryiterator->hasChildren( $allowLinks // bool allowLinks ); // Return Values // Returns whether the current entry is a directory, but not '.' or '..' // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.haschildren.php // ========== RECURSIVEDIRECTORYITERATOR_HASCHILDREN - END // SYNTAX: // bool RecursiveDirectoryIterator::hasChildren(bool $allowLinks = false) return $return_recursivedirectoryiterator_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_HASCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Return path and filename of current dir entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::key() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_key($recursivedirectoryiterator) { $return_recursivedirectoryiterator_key = null; // ========== RECURSIVEDIRECTORYITERATOR_KEY - BEGIN // ===== ABOUT // Return path and filename of current dir entry // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::key(): string // ===== CODE $return_recursivedirectoryiterator_key = $recursivedirectoryiterator->key( // This function has no parameters. ); // Return Values // The path and filename of the current dir entry. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.key.php // ========== RECURSIVEDIRECTORYITERATOR_KEY - END // SYNTAX: // string RecursiveDirectoryIterator::key() return $return_recursivedirectoryiterator_key; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to next entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::next() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_next($recursivedirectoryiterator) { // ========== RECURSIVEDIRECTORYITERATOR_NEXT - BEGIN // ===== ABOUT // Move to next entry // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::next(): void // ===== CODE $recursivedirectoryiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.next.php // ========== RECURSIVEDIRECTORYITERATOR_NEXT - END // SYNTAX: // void RecursiveDirectoryIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind dir back to the start. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveDirectoryIterator::rewind() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivedirectoryiterator_rewind($recursivedirectoryiterator) { // ========== RECURSIVEDIRECTORYITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind dir back to the start // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveDirectoryIterator::rewind(): void // ===== CODE $recursivedirectoryiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivedirectoryiterator.rewind.php // ========== RECURSIVEDIRECTORYITERATOR_REWIND - END // SYNTAX: // void RecursiveDirectoryIterator::rewind() // return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR_REWIND // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEDIRECTORYITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_CONSTRUCT - RecursiveFilterIterator php_basic_spl_iterators_recursivefilteriterator_construct(RecursiveIterator $iterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_GETCHILDREN - RecursiveFilterIterator php_basic_spl_iterators_recursivefilteriterator_getchildren(RecursiveFilterIterator $recursivefilteriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_HASCHILDREN - bool php_basic_spl_iterators_recursivefilteriterator_haschildren(RecursiveFilterIterator $recursivefilteriterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (3) // RecursiveFilterIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveFilterIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveFilterIterator::hasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // RecursiveFilterIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Create a RecursiveFilterIterator from a RecursiveIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveFilterIterator::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivefilteriterator_construct($iterator) { $return_recursivefilteriterator_construct = null; // ========== RECURSIVEFILTERITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Create a RecursiveFilterIterator from a RecursiveIterator // ===== DESCRIPTION // Create a RecursiveFilterIterator from a RecursiveIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveFilterIterator::__construct(RecursiveIterator $iterator) // ===== CODE $return_recursivefilteriterator_construct = new RecursiveFilterIterator( $iterator // RecursiveIterator iterator - The RecursiveIterator to be filtered. ); // Return // RecursiveFilterIterator // // [examples] // Examples // [example] // Example #1 Basic RecursiveFilterIterator() example // [php] // class TestsOnlyFilter extends RecursiveFilterIterator { // public function accept() { // // Accept the current item if we can recurse into it // // or it is a value starting with "test" // return $this->hasChildren() || (strpos($this->current(), "test") !== FALSE); // } // } // // $array = array("test1", array("taste2", "test3", "test4"), "test5"); // $iterator = new RecursiveArrayIterator($array); // $filter = new TestsOnlyFilter($iterator); // // foreach(new RecursiveIteratorIterator($filter) as $key => $value) // { // echo $value . "\n"; // } // [/php] // The above example will output something similar to: // [result] // test1 // test3 // test4 // test5 // [/result] // [/example] // [example] // Example #2 RecursiveFilterIterator() example // [php] // class StartsWithFilter extends RecursiveFilterIterator { // // protected $word; // // public function __construct(RecursiveIterator $rit, $word) { // $this->word = $word; // parent::__construct($rit); // } // // public function accept() { // return $this->hasChildren() OR strpos($this->current(), $this->word) === 0; // } // // public function getChildren() { // return new self($this->getInnerIterator()->getChildren(), $this->word); // } // } // // $array = array("test1", array("taste2", "test3", "test4"), "test5"); // $iterator = new RecursiveArrayIterator($array); // $filter = new StartsWithFilter($iterator, "test"); // // foreach(new RecursiveIteratorIterator($filter) as $key => $value) // { // echo $value . "\n"; // } // [/php] // The above example will output something similar to: // [result] // test1 // test3 // test4 // test5 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivefilteriterator.construct.php // ========== RECURSIVEFILTERITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveFilterIterator RecursiveFilterIterator::__construct(RecursiveIterator $iterator) return $return_recursivefilteriterator_construct; // RecursiveFilterIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Return the inner iterator's children contained in a RecursiveFilterIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveFilterIterator::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivefilteriterator_getchildren($recursivefilteriterator) { $return_recursivefilteriterator_getchildren = null; // ========== RECURSIVEFILTERITERATOR_GETCHILDREN - BEGIN // ===== ABOUT // Return the inner iterator's children contained in a RecursiveFilterIterator // ===== DESCRIPTION // Return the inner iterator's children contained in a RecursiveFilterIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveFilterIterator::getChildren(): ?RecursiveFilterIterator // ===== CODE $return_recursivefilteriterator_getchildren = $recursivefilteriterator->getChildren( // This function has no parameters. ); // Return Values // Returns a RecursiveFilterIterator containing the inner iterator's children. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivefilteriterator.getchildren.php // ========== RECURSIVEFILTERITERATOR_GETCHILDREN - END // SYNTAX: // RecursiveFilterIterator RecursiveFilterIterator::getChildren() return $return_recursivefilteriterator_getchildren; // RecursiveFilterIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Check whether the inner iterator's current element has children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveFilterIterator::hasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivefilteriterator_haschildren($recursivefilteriterator) { $return_recursivefilteriterator_haschildren = false; // ========== RECURSIVEFILTERITERATOR_HASCHILDREN - BEGIN // ===== ABOUT // Check whether the inner iterator's current element has children // ===== DESCRIPTION // Check whether the inner iterator's current element has children. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveFilterIterator::hasChildren(): bool // ===== CODE $return_recursivefilteriterator_haschildren = $recursivefilteriterator->hasChildren( // This function has no parameters. ); // Return Values // true if the inner iterator has children, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivefilteriterator.haschildren.php // ========== RECURSIVEFILTERITERATOR_HASCHILDREN - END // SYNTAX: // bool RecursiveFilterIterator::hasChildren() return $return_recursivefilteriterator_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR_HASCHILDREN // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEFILTERITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_BEGINCHILDREN - void php_basic_spl_iterators_recursiveiteratoriterator_beginchildren(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_BEGINITERATION - void php_basic_spl_iterators_recursiveiteratoriterator_beginiteration(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CALLGETCHILDREN - RecursiveIterator php_basic_spl_iterators_recursiveiteratoriterator_callgetchildren(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CALLHASCHILDREN - bool php_basic_spl_iterators_recursiveiteratoriterator_callhaschildren(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CONSTRUCT - RecursiveIteratorIterator php_basic_spl_iterators_recursiveiteratoriterator_construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CURRENT - mixed php_basic_spl_iterators_recursiveiteratoriterator_current(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_ENDCHILDREN - void php_basic_spl_iterators_recursiveiteratoriterator_endchildren(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_ENDITERATION - void php_basic_spl_iterators_recursiveiteratoriterator_enditeration(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETDEPTH - int php_basic_spl_iterators_recursiveiteratoriterator_getdepth(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETINNERITERATOR - RecursiveIterator php_basic_spl_iterators_recursiveiteratoriterator_getinneriterator(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETMAXDEPTH - int|false php_basic_spl_iterators_recursiveiteratoriterator_getmaxdepth(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETSUBITERATOR - RecursiveIterator php_basic_spl_iterators_recursiveiteratoriterator_getsubiterator(RecursiveIteratorIterator $recursiveiteratoriterator, int $level = null) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_KEY - mixed php_basic_spl_iterators_recursiveiteratoriterator_key(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_NEXT - void php_basic_spl_iterators_recursiveiteratoriterator_next(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_NEXTELEMENT - void php_basic_spl_iterators_recursiveiteratoriterator_nextelement(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_REWIND - void php_basic_spl_iterators_recursiveiteratoriterator_rewind(RecursiveIteratorIterator $recursiveiteratoriterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_SETMAXDEPTH - void php_basic_spl_iterators_recursiveiteratoriterator_setmaxdepth(RecursiveIteratorIterator $recursiveiteratoriterator, int $maxDepth = -1) // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_VALID - bool php_basic_spl_iterators_recursiveiteratoriterator_valid(RecursiveIteratorIterator $recursiveiteratoriterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (18) // RecursiveIteratorIterator::beginChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::beginIteration() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::callGetChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::callHasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::__construct() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // RecursiveIteratorIterator::current() - PHP_5, PHP_7, PHP_8 // RecursiveIteratorIterator::endChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::endIteration() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::getDepth() - PHP_5, PHP_7, PHP_8 // RecursiveIteratorIterator::getInnerIterator() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::getMaxDepth() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::getSubIterator() - PHP_5, PHP_7, PHP_8 // RecursiveIteratorIterator::key() - PHP_5, PHP_7, PHP_8 // RecursiveIteratorIterator::next() - PHP_5, PHP_7, PHP_8 // RecursiveIteratorIterator::nextElement() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::rewind() - PHP_5, PHP_7, PHP_8 // RecursiveIteratorIterator::setMaxDepth() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // RecursiveIteratorIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== USING DATA_TYPES (8) // void // RecursiveIteratorIterator - PHP_5, PHP_7, PHP_8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // bool // Traversable - PHP_5, PHP_7, PHP_8 // int // mixed // false // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_BEGINCHILDREN // ============================== PUBLIC // ============================== ABOUT // Begin children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::beginChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_beginchildren($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_BEGINCHILDREN - BEGIN // ===== ABOUT // Begin children // ===== DESCRIPTION // Is called after calling RecursiveIteratorIterator::getChildren(), and its associated RecursiveIteratorIterator::rewind(). // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::beginChildren(): void // ===== CODE $recursiveiteratoriterator->beginChildren( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.beginchildren.php // ========== RECURSIVEITERATORITERATOR_BEGINCHILDREN - END // SYNTAX: // void RecursiveIteratorIterator::beginChildren() // return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_BEGINCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_BEGINITERATION // ============================== PUBLIC // ============================== ABOUT // Begin Iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::beginIteration() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_beginiteration($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_BEGINITERATION - BEGIN // ===== ABOUT // Begin Iteration // ===== DESCRIPTION // Called when iteration begins (after the first RecursiveIteratorIterator::rewind() call. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::beginIteration(): void // ===== CODE $recursiveiteratoriterator->beginIteration( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.beginiteration.php // ========== RECURSIVEITERATORITERATOR_BEGINITERATION - END // SYNTAX: // void RecursiveIteratorIterator::beginIteration() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_BEGINITERATION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CALLGETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Get children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::callGetChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_callgetchildren($recursiveiteratoriterator) { $return_recursiveiteratoriterator_callgetchildren = null; // ========== RECURSIVEITERATORITERATOR_CALLGETCHILDREN - BEGIN // ===== ABOUT // Get children // ===== DESCRIPTION // Get children of the current element. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::callGetChildren(): ?RecursiveIterator // ===== CODE $return_recursiveiteratoriterator_callgetchildren = $recursiveiteratoriterator->callGetChildren( // This function has no parameters. ); // Return Values // A RecursiveIterator() on success, or null on failure. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.callgetchildren.php // ========== RECURSIVEITERATORITERATOR_CALLGETCHILDREN - END // SYNTAX: // RecursiveIterator RecursiveIteratorIterator::callGetChildren() return $return_recursiveiteratoriterator_callgetchildren; // RecursiveIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CALLGETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CALLHASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Has children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::callHasChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_callhaschildren($recursiveiteratoriterator) { $return_recursiveiteratoriterator_callhaschildren = false; // ========== RECURSIVEITERATORITERATOR_CALLHASCHILDREN - BEGIN // ===== ABOUT // Has children // ===== DESCRIPTION // Called for each element to test whether it has children. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::callHasChildren(): bool // ===== CODE $return_recursiveiteratoriterator_callhaschildren = $recursiveiteratoriterator->callHasChildren( // This function has no parameters. ); // Return Values // Returns whether the element has children. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.callhaschildren.php // ========== RECURSIVEITERATORITERATOR_CALLHASCHILDREN - END // SYNTAX: // bool RecursiveIteratorIterator::callHasChildren() return $return_recursiveiteratoriterator_callhaschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CALLHASCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a RecursiveIteratorIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::__construct() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // RecursiveIteratorIterator::LEAVES_ONLY - RecursiveIteratorIterator::__construct() // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_construct($iterator, $mode = RecursiveIteratorIterator::LEAVES_ONLY, $flags = 0) { $return_recursiveiteratoriterator_construct = null; // ========== RECURSIVEITERATORITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a RecursiveIteratorIterator // ===== DESCRIPTION // Creates a RecursiveIteratorIterator from a RecursiveIterator. // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::__construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0) // ===== CODE $return_recursiveiteratoriterator_construct = new RecursiveIteratorIterator( $iterator, // Traversable iterator - The iterator being constructed from. Either a RecursiveIterator or IteratorAggregate. $mode, // int mode - Optional mode. Possible values are // * RecursiveIteratorIterator::LEAVES_ONLY - The default. Lists only leaves in iteration. // * RecursiveIteratorIterator::SELF_FIRST - Lists leaves and parents in iteration with parents coming first. // * RecursiveIteratorIterator::CHILD_FIRST - Lists leaves and parents in iteration with leaves coming first. $flags // int flags - Optional flag. Possible values are RecursiveIteratorIterator::CATCH_GET_CHILD which will then ignore exceptions thrown in calls to RecursiveIteratorIterator::getChildren(). ); // Return // RecursiveIteratorIterator // // [examples] // Examples // [example] // Example #1 Iterating a RecursiveIteratorIterator // [php] // $array = array( // array( // array( // array( // 'leaf-0-0-0-0', // 'leaf-0-0-0-1' // ), // 'leaf-0-0-0' // ), // array( // array( // 'leaf-0-1-0-0', // 'leaf-0-1-0-1' // ), // 'leaf-0-1-0' // ), // 'leaf-0-0' // ) // ); // // $iterator = new RecursiveIteratorIterator( // new RecursiveArrayIterator($array), // $mode // ); // foreach ($iterator as $key => $leaf) { // echo "$key => $leaf", PHP_EOL; // } // [/php] // Output with $mode = RecursiveIteratorIterator::LEAVES_ONLY // [result] // 0 => leaf-0-0-0-0 // 1 => leaf-0-0-0-1 // 0 => leaf-0-0-0 // 0 => leaf-0-1-0-0 // 1 => leaf-0-1-0-1 // 0 => leaf-0-1-0 // 0 => leaf-0-0 // [/result] // Output with $mode = RecursiveIteratorIterator::SELF_FIRST // [result] // 0 => Array // 0 => Array // 0 => Array // 0 => leaf-0-0-0-0 // 1 => leaf-0-0-0-1 // 1 => leaf-0-0-0 // 1 => Array // 0 => Array // 0 => leaf-0-1-0-0 // 1 => leaf-0-1-0-1 // 1 => leaf-0-1-0 // 2 => leaf-0-0 // [/result] // Output with $mode = RecursiveIteratorIterator::CHILD_FIRST // [result] // 0 => leaf-0-0-0-0 // 1 => leaf-0-0-0-1 // 0 => Array // 1 => leaf-0-0-0 // 0 => Array // 0 => leaf-0-1-0-0 // 1 => leaf-0-1-0-1 // 0 => Array // 1 => leaf-0-1-0 // 1 => Array // 2 => leaf-0-0 // 0 => Array // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.construct.php // ========== RECURSIVEITERATORITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveIteratorIterator RecursiveIteratorIterator::__construct(Traversable $iterator, int $mode = RecursiveIteratorIterator::LEAVES_ONLY, int $flags = 0) return $return_recursiveiteratoriterator_construct; // RecursiveIteratorIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Access the current element value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::current() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_current($recursiveiteratoriterator) { $return_recursiveiteratoriterator_current = null; // ========== RECURSIVEITERATORITERATOR_CURRENT - BEGIN // ===== ABOUT // Access the current element value // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::current(): mixed // ===== CODE $return_recursiveiteratoriterator_current = $recursiveiteratoriterator->current( // This function has no parameters. ); // Return Values // The current elements value. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.current.php // ========== RECURSIVEITERATORITERATOR_CURRENT - END // SYNTAX: // mixed RecursiveIteratorIterator::current() return $return_recursiveiteratoriterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_ENDCHILDREN // ============================== PUBLIC // ============================== ABOUT // End children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::endChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_endchildren($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_ENDCHILDREN - BEGIN // ===== ABOUT // End children // ===== DESCRIPTION // Called when end recursing one level. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::endChildren(): void // ===== CODE $recursiveiteratoriterator->endChildren( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.endchildren.php // ========== RECURSIVEITERATORITERATOR_ENDCHILDREN - END // SYNTAX: // void RecursiveIteratorIterator::endChildren() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_ENDCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_ENDITERATION // ============================== PUBLIC // ============================== ABOUT // End Iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::endIteration() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_enditeration($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_ENDITERATION - BEGIN // ===== ABOUT // End Iteration // ===== DESCRIPTION // Called when the iteration ends (when RecursiveIteratorIterator::valid() first returns false. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::endIteration(): void // ===== CODE $recursiveiteratoriterator->endIteration( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.enditeration.php // ========== RECURSIVEITERATORITERATOR_ENDITERATION - END // SYNTAX: // void RecursiveIteratorIterator::endIteration() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_ENDITERATION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETDEPTH // ============================== PUBLIC // ============================== ABOUT // Get the current depth of the recursive iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::getDepth() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_getdepth($recursiveiteratoriterator) { $return_recursiveiteratoriterator_getdepth = 0; // ========== RECURSIVEITERATORITERATOR_GETDEPTH - BEGIN // ===== ABOUT // Get the current depth of the recursive iteration // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::getDepth(): int // ===== CODE $return_recursiveiteratoriterator_getdepth = $recursiveiteratoriterator->getDepth( // This function has no parameters. ); // Return Values // The current depth of the recursive iteration. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.getdepth.php // ========== RECURSIVEITERATORITERATOR_GETDEPTH - END // SYNTAX: // int RecursiveIteratorIterator::getDepth() return $return_recursiveiteratoriterator_getdepth; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETDEPTH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETINNERITERATOR // ============================== PUBLIC // ============================== ABOUT // Get inner iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::getInnerIterator() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_getinneriterator($recursiveiteratoriterator) { $return_recursiveiteratoriterator_getinneriterator = null; // ========== RECURSIVEITERATORITERATOR_GETINNERITERATOR - BEGIN // ===== ABOUT // Get inner iterator // ===== DESCRIPTION // Gets the current active sub iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::getInnerIterator(): RecursiveIterator // ===== CODE $return_recursiveiteratoriterator_getinneriterator = $recursiveiteratoriterator->getInnerIterator( // This function has no parameters. ); // Return Values // The current active sub iterator. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.getinneriterator.php // ========== RECURSIVEITERATORITERATOR_GETINNERITERATOR - END // SYNTAX: // RecursiveIterator RecursiveIteratorIterator::getInnerIterator() return $return_recursiveiteratoriterator_getinneriterator; // RecursiveIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETINNERITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETMAXDEPTH // ============================== PUBLIC // ============================== ABOUT // Get max depth. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::getMaxDepth() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_getmaxdepth($recursiveiteratoriterator) { $return_recursiveiteratoriterator_getmaxdepth = false; // ========== RECURSIVEITERATORITERATOR_GETMAXDEPTH - BEGIN // ===== ABOUT // Get max depth // ===== DESCRIPTION // Gets the maximum allowable depth. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::getMaxDepth(): int|false // ===== CODE $return_recursiveiteratoriterator_getmaxdepth = $recursiveiteratoriterator->getMaxDepth( // This function has no parameters. ); // Return Values // The maximum accepted depth, or false if any depth is allowed. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.getmaxdepth.php // ========== RECURSIVEITERATORITERATOR_GETMAXDEPTH - END // SYNTAX: // int|false RecursiveIteratorIterator::getMaxDepth() return $return_recursiveiteratoriterator_getmaxdepth; // int|false } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETMAXDEPTH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETSUBITERATOR // ============================== PUBLIC // ============================== ABOUT // The current active sub iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::getSubIterator() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_getsubiterator($recursiveiteratoriterator, $level = null) { $return_recursiveiteratoriterator_getsubiterator = null; // ========== RECURSIVEITERATORITERATOR_GETSUBITERATOR - BEGIN // ===== ABOUT // The current active sub iterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::getSubIterator(?int $level = null): ?RecursiveIterator // ===== CODE $return_recursiveiteratoriterator_getsubiterator = $recursiveiteratoriterator->getSubIterator( $level // int $level ); // Return Values // The current active sub iterator on success; null on failure. // // Changelog // Version - Description // 8.0.0 - level is now nullable. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.getsubiterator.php // ========== RECURSIVEITERATORITERATOR_GETSUBITERATOR - END // SYNTAX: // RecursiveIterator RecursiveIteratorIterator::getSubIterator(int $level = null) return $return_recursiveiteratoriterator_getsubiterator; // RecursiveIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_GETSUBITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Access the current key. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::key() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_key($recursiveiteratoriterator) { $return_recursiveiteratoriterator_key = null; // ========== RECURSIVEITERATORITERATOR_KEY - BEGIN // ===== ABOUT // Access the current key // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::key(): mixed // ===== CODE $return_recursiveiteratoriterator_key = $recursiveiteratoriterator->key( // This function has no parameters. ); // Return Values // The current key. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.key.php // ========== RECURSIVEITERATORITERATOR_KEY - END // SYNTAX: // mixed RecursiveIteratorIterator::key() return $return_recursiveiteratoriterator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move forward to the next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::next() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_next($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_NEXT - BEGIN // ===== ABOUT // Move forward to the next element // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::next(): void // ===== CODE $recursiveiteratoriterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.next.php // ========== RECURSIVEITERATORITERATOR_NEXT - END // SYNTAX: // void RecursiveIteratorIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_NEXTELEMENT // ============================== PUBLIC // ============================== ABOUT // Next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::nextElement() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_nextelement($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_NEXTELEMENT - BEGIN // ===== ABOUT // Next element // ===== DESCRIPTION // Called when the next element is available. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::nextElement(): void // ===== CODE $recursiveiteratoriterator->nextElement( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.nextelement.php // ========== RECURSIVEITERATORITERATOR_NEXTELEMENT - END // SYNTAX: // void RecursiveIteratorIterator::nextElement() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_NEXTELEMENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the iterator to the first element of the top level inner iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::rewind() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_rewind($recursiveiteratoriterator) { // ========== RECURSIVEITERATORITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind the iterator to the first element of the top level inner iterator // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::rewind(): void // ===== CODE $recursiveiteratoriterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.rewind.php // ========== RECURSIVEITERATORITERATOR_REWIND - END // SYNTAX: // void RecursiveIteratorIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_SETMAXDEPTH // ============================== PUBLIC // ============================== ABOUT // Set max depth. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::setMaxDepth() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_setmaxdepth($recursiveiteratoriterator, $maxDepth = -1) { // ========== RECURSIVEITERATORITERATOR_SETMAXDEPTH - BEGIN // ===== ABOUT // Set max depth // ===== DESCRIPTION // Set the maximum allowed depth. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::setMaxDepth(int $maxDepth = -1): void // ===== CODE $recursiveiteratoriterator->setMaxDepth( $maxDepth // int maxDepth - The maximum allowed depth. -1 is used for any depth. ); // Return Values // No value is returned. // // Errors/Exceptions // Emits an Exception if maxDepth is less than -1. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.setmaxdepth.php // ========== RECURSIVEITERATORITERATOR_SETMAXDEPTH - END // SYNTAX: // void RecursiveIteratorIterator::setMaxDepth(int $maxDepth = -1) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_SETMAXDEPTH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check whether the current position is valid. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveIteratorIterator::valid() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveiteratoriterator_valid($recursiveiteratoriterator) { $return_recursiveiteratoriterator_valid = false; // ========== RECURSIVEITERATORITERATOR_VALID - BEGIN // ===== ABOUT // Check whether the current position is valid // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveIteratorIterator::valid(): bool // ===== CODE $return_recursiveiteratoriterator_valid = $recursiveiteratoriterator->valid( // This function has no parameters. ); // Return Values // true if the current position is valid, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveiteratoriterator.valid.php // ========== RECURSIVEITERATORITERATOR_VALID - END // SYNTAX: // bool RecursiveIteratorIterator::valid() return $return_recursiveiteratoriterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEITERATORITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_CONSTRUCT - RecursiveRegexIterator php_basic_spl_iterators_recursiveregexiterator_construct(RecursiveIterator $iterator, string $pattern, int $mode = RecursiveRegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_GETCHILDREN - RecursiveRegexIterator php_basic_spl_iterators_recursiveregexiterator_getchildren(RecursiveRegexIterator $recursiveregexiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_HASCHILDREN - bool php_basic_spl_iterators_recursiveregexiterator_haschildren(RecursiveRegexIterator $recursiveregexiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (3) // RecursiveRegexIterator::__construct() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RecursiveRegexIterator::getChildren() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RecursiveRegexIterator::hasChildren() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (5) // RecursiveRegexIterator - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // string // int // bool // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Creates a new RecursiveRegexIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveRegexIterator::__construct() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // RecursiveRegexIterator::MATCH - RecursiveRegexIterator::__construct() // ============================== CODE function php_basic_spl_iterators_recursiveregexiterator_construct($iterator, $pattern, $mode = RecursiveRegexIterator::MATCH, $flags = 0, $pregFlags = 0) { $return_recursiveregexiterator_construct = null; // ========== RECURSIVEREGEXITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Creates a new RecursiveRegexIterator // ===== DESCRIPTION // Creates a new regular expression iterator. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveRegexIterator::__construct( // RecursiveIterator $iterator, // string $pattern, // int $mode = RecursiveRegexIterator::MATCH, // int $flags = 0, // int $pregFlags = 0 // ) // ===== CODE $return_recursiveregexiterator_construct = new RecursiveRegexIterator( $iterator, // RecursiveIterator iterator - The recursive iterator to apply this regex filter to. $pattern, // string pattern - The regular expression to match. $mode, // int mode - Operation mode, see RegexIterator::setMode() for a list of modes. $flags, // int flags - Special flags, see RegexIterator::setFlags() for a list of available flags. $pregFlags // int pregFlags - The regular expression flags. These flags depend on the operation mode parameter: // RegexIterator preg_flags // operation mode - available flags // RecursiveRegexIterator::ALL_MATCHES - See preg_match_all(). // RecursiveRegexIterator::GET_MATCH - See preg_match(). // RecursiveRegexIterator::MATCH - See preg_match(). // RecursiveRegexIterator::REPLACE - none. // RecursiveRegexIterator::SPLIT - See preg_split().iterator ); // Return // RecursiveRegexIterator // // [examples] // Examples // [example] // Example #1 RecursiveRegexIterator::__construct() example // Creates a new RegexIterator that filters all strings that start with 'test'. // [php] // $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); // $rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^test/', // RecursiveRegexIterator::ALL_MATCHES); // // foreach ($rRegexIterator as $key1 => $value1) { // // if ($rRegexIterator->hasChildren()) { // // // print all children // echo "Children: "; // foreach ($rRegexIterator->getChildren() as $key => $value) { // echo $value . " "; // } // echo "\n"; // } else { // echo "No children\n"; // } // // } // [/php] // The above example will output something similar to: // [result] // No children // Children: test4 test5 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveregexiterator.construct.php // ========== RECURSIVEREGEXITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveRegexIterator RecursiveRegexIterator::__construct(RecursiveIterator $iterator, string $pattern, int $mode = RecursiveRegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) return $return_recursiveregexiterator_construct; // RecursiveRegexIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Returns an iterator for the current entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveRegexIterator::getChildren() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveregexiterator_getchildren($recursiveregexiterator) { $return_recursiveregexiterator_getchildren = null; // ========== RECURSIVEREGEXITERATOR_GETCHILDREN - BEGIN // ===== ABOUT // Returns an iterator for the current entry // ===== DESCRIPTION // Returns an iterator for the current iterator entry. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveRegexIterator::getChildren(): RecursiveRegexIterator // ===== CODE $return_recursiveregexiterator_getchildren = $recursiveregexiterator->getChildren( // This function has no parameters. ); // Return Values // An iterator for the current entry, if it can be iterated over by the inner iterator. // // Errors/Exceptions // An InvalidArgumentException will be thrown if the current entry does not contain a value that can be iterated over by the inner iterator. // // [examples] // Examples // [example] // Example #1 RecursiveRegexIterator::getChildren() example // [php] // $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); // $rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^test/', // RecursiveRegexIterator::ALL_MATCHES); // // foreach ($rRegexIterator as $key1 => $value1) { // // if ($rRegexIterator->hasChildren()) { // // // print all children // echo "Children: "; // foreach ($rRegexIterator->getChildren() as $key => $value) { // echo $value . " "; // } // echo "\n"; // } else { // echo "No children\n"; // } // // } // [/php] // The above example will output: // [result] // No children // Children: test4 test5 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveregexiterator.getchildren.php // ========== RECURSIVEREGEXITERATOR_GETCHILDREN - END // SYNTAX: // RecursiveRegexIterator RecursiveRegexIterator::getChildren() return $return_recursiveregexiterator_getchildren; // RecursiveRegexIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Returns whether an iterator can be obtained for the current entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveRegexIterator::hasChildren() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursiveregexiterator_haschildren($recursiveregexiterator) { $return_recursiveregexiterator_haschildren = false; // ========== RECURSIVEREGEXITERATOR_HASCHILDREN - BEGIN // ===== ABOUT // Returns whether an iterator can be obtained for the current entry // ===== DESCRIPTION // Returns whether an iterator can be obtained for the current entry. This iterator can be obtained via RecursiveRegexIterator::getChildren(). // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveRegexIterator::hasChildren(): bool // ===== CODE $return_recursiveregexiterator_haschildren = $recursiveregexiterator->hasChildren( // This function has no parameters. ); // Return Values // Returns true if an iterator can be obtained for the current entry, otherwise returns false. // // [examples] // Examples // [example] // Example #1 RecursiveRegexIterator::hasChildren() example // [php] // $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); // $rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^test/', // RecursiveRegexIterator::ALL_MATCHES); // // foreach ($rRegexIterator as $value) { // var_dump($rRegexIterator->hasChildren()); // } // [/php] // The above example will output: // [result] // bool(false) // bool(true) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursiveregexiterator.haschildren.php // ========== RECURSIVEREGEXITERATOR_HASCHILDREN - END // SYNTAX: // bool RecursiveRegexIterator::hasChildren() return $return_recursiveregexiterator_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR_HASCHILDREN // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVEREGEXITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_BEGINCHILDREN - void php_basic_spl_iterators_recursivetreeiterator_beginchildren(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_BEGINITERATION - RecursiveIterator php_basic_spl_iterators_recursivetreeiterator_beginiteration(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CALLGETCHILDREN - RecursiveIterator php_basic_spl_iterators_recursivetreeiterator_callgetchildren(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CALLHASCHILDREN - bool php_basic_spl_iterators_recursivetreeiterator_callhaschildren(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CONSTRUCT - RecursiveTreeIterator php_basic_spl_iterators_recursivetreeiterator_construct(RecursiveIterator|IteratorAggregate $iterator, int $flags = RecursiveTreeIterator::BYPASS_KEY, int $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD, int $mode = RecursiveTreeIterator::SELF_FIRST) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CURRENT - mixed php_basic_spl_iterators_recursivetreeiterator_current(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_ENDCHILDREN - void php_basic_spl_iterators_recursivetreeiterator_endchildren(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_ENDITERATION - void php_basic_spl_iterators_recursivetreeiterator_enditeration(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETENTRY - string php_basic_spl_iterators_recursivetreeiterator_getentry(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETPOSTFIX - string php_basic_spl_iterators_recursivetreeiterator_getpostfix(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETPREFIX - string php_basic_spl_iterators_recursivetreeiterator_getprefix(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_KEY - mixed php_basic_spl_iterators_recursivetreeiterator_key(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_NEXT - void php_basic_spl_iterators_recursivetreeiterator_next(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_NEXTELEMENT - void php_basic_spl_iterators_recursivetreeiterator_nextelement(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_REWIND - void php_basic_spl_iterators_recursivetreeiterator_rewind(RecursiveTreeIterator $recursivetreeiterator) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_SETPOSTFIX - void php_basic_spl_iterators_recursivetreeiterator_setpostfix(RecursiveTreeIterator $recursivetreeiterator, string $postfix) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_SETPREFIXPART - void php_basic_spl_iterators_recursivetreeiterator_setprefixpart(RecursiveTreeIterator $recursivetreeiterator, int $part, string $value) // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_VALID - bool php_basic_spl_iterators_recursivetreeiterator_valid(RecursiveTreeIterator $recursivetreeiterator) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (18) // RecursiveTreeIterator::beginChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::beginIteration() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::callGetChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::callHasChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::endChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::endIteration() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::getEntry() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::getPostfix() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::getPrefix() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::nextElement() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::setPostfix() - PHP_5 >= PHP_5_5_3, PHP_7, PHP_8 // RecursiveTreeIterator::setPrefixPart() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveTreeIterator::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (8) // void // RecursiveTreeIterator - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // RecursiveIterator - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // bool // IteratorAggregate - PHP_5, PHP_7, PHP_8 // int // mixed // string // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_BEGINCHILDREN // ============================== PUBLIC // ============================== ABOUT // Begin children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::beginChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_beginchildren($recursivetreeiterator) { // ========== RECURSIVETREEITERATOR_BEGINCHILDREN - BEGIN // ===== ABOUT // Begin children // ===== DESCRIPTION // Called when recursing one level down. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::beginChildren(): void // ===== CODE $recursivetreeiterator->beginChildren( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.beginchildren.php // ========== RECURSIVETREEITERATOR_BEGINCHILDREN - END // SYNTAX: // void RecursiveTreeIterator::beginChildren() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_BEGINCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_BEGINITERATION // ============================== PUBLIC // ============================== ABOUT // Begin iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::beginIteration() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_beginiteration($recursivetreeiterator) { $return_recursivetreeiterator_beginiteration = null; // ========== RECURSIVETREEITERATOR_BEGINITERATION - BEGIN // ===== ABOUT // Begin iteration // ===== DESCRIPTION // Called when iteration begins (after the first RecursiveTreeIterator::rewind() call). // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::beginIteration(): RecursiveIterator // ===== CODE $return_recursivetreeiterator_beginiteration = $recursivetreeiterator->beginIteration( // This function has no parameters. ); // Return Values // A RecursiveIterator. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.beginiteration.php // ========== RECURSIVETREEITERATOR_BEGINITERATION - END // SYNTAX: // RecursiveIterator RecursiveTreeIterator::beginIteration() return $return_recursivetreeiterator_beginiteration; // RecursiveIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_BEGINITERATION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CALLGETCHILDREN // ============================== PUBLIC // ============================== ABOUT // Get children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::callGetChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_callgetchildren($recursivetreeiterator) { $return_recursivetreeiterator_callgetchildren = null; // ========== RECURSIVETREEITERATOR_CALLGETCHILDREN - BEGIN // ===== ABOUT // Get children // ===== DESCRIPTION // Gets children of the current element. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::callGetChildren(): RecursiveIterator // ===== CODE $return_recursivetreeiterator_callgetchildren = $recursivetreeiterator->callGetChildren( // This function has no parameters. ); // Return Values // A RecursiveIterator. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.callgetchildren.php // ========== RECURSIVETREEITERATOR_CALLGETCHILDREN - END // SYNTAX: // RecursiveIterator RecursiveTreeIterator::callGetChildren() return $return_recursivetreeiterator_callgetchildren; // RecursiveIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CALLGETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CALLHASCHILDREN // ============================== PUBLIC // ============================== ABOUT // Has children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::callHasChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_callhaschildren($recursivetreeiterator) { $return_recursivetreeiterator_callhaschildren = false; // ========== RECURSIVETREEITERATOR_CALLHASCHILDREN - BEGIN // ===== ABOUT // Has children // ===== DESCRIPTION // Called for each element to test whether it has children. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::callHasChildren(): bool // ===== CODE $return_recursivetreeiterator_callhaschildren = $recursivetreeiterator->callHasChildren( // This function has no parameters. ); // Return Values // true if there are children, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.callhaschildren.php // ========== RECURSIVETREEITERATOR_CALLHASCHILDREN - END // SYNTAX: // bool RecursiveTreeIterator::callHasChildren() return $return_recursivetreeiterator_callhaschildren; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CALLHASCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a RecursiveTreeIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::__construct() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (3) // RecursiveTreeIterator::BYPASS_KEY - RecursiveTreeIterator::__construct() // CachingIterator::CATCH_GET_CHILD - RecursiveTreeIterator::__construct() // RecursiveTreeIterator::SELF_FIRST - RecursiveTreeIterator::__construct() // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_construct($iterator, $flags = RecursiveTreeIterator::BYPASS_KEY, $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD, $mode = RecursiveTreeIterator::SELF_FIRST) { $return_recursivetreeiterator_construct = null; // ========== RECURSIVETREEITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Construct a RecursiveTreeIterator // ===== DESCRIPTION // Constructs a new RecursiveTreeIterator from the supplied recursive iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::__construct( // RecursiveIterator|IteratorAggregate $iterator, // int $flags = RecursiveTreeIterator::BYPASS_KEY, // int $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD, // int $mode = RecursiveTreeIterator::SELF_FIRST // ) // ===== CODE $return_recursivetreeiterator_construct = new RecursiveTreeIterator( $iterator, // RecursiveIterator|IteratorAggregate iterator - The RecursiveIterator or IteratorAggregate to iterate over. $flags, // int flags - Flags may be provided which will affect the behavior of some methods. A list of the flags can found under RecursiveTreeIterator predefined constants. $cachingIteratorFlags, // int caching_it_flags - Flags to affect the behavior of the RecursiveCachingIterator used internally. $mode // int mode - Flags to affect the behavior of the RecursiveIteratorIterator used internally. ); // Return // RecursiveTreeIterator // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.construct.php // ========== RECURSIVETREEITERATOR_CONSTRUCT - END // SYNTAX: // RecursiveTreeIterator RecursiveTreeIterator::__construct(RecursiveIterator|IteratorAggregate $iterator, int $flags = RecursiveTreeIterator::BYPASS_KEY, int $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD, int $mode = RecursiveTreeIterator::SELF_FIRST) return $return_recursivetreeiterator_construct; // RecursiveTreeIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CURRENT // ============================== PUBLIC // ============================== ABOUT // Get current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::current() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_current($recursivetreeiterator) { $return_recursivetreeiterator_current = null; // ========== RECURSIVETREEITERATOR_CURRENT - BEGIN // ===== ABOUT // Get current element // ===== DESCRIPTION // Gets the current element prefixed and postfixed. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::current(): mixed // ===== CODE $return_recursivetreeiterator_current = $recursivetreeiterator->current( // This function has no parameters. ); // Return Values // Returns the current element prefixed and postfixed. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.current.php // ========== RECURSIVETREEITERATOR_CURRENT - END // SYNTAX: // mixed RecursiveTreeIterator::current() return $return_recursivetreeiterator_current; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_ENDCHILDREN // ============================== PUBLIC // ============================== ABOUT // End children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::endChildren() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_endchildren($recursivetreeiterator) { // ========== RECURSIVETREEITERATOR_ENDCHILDREN - BEGIN // ===== ABOUT // End children // ===== DESCRIPTION // Called when end recursing one level. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::endChildren(): void // ===== CODE $recursivetreeiterator->endChildren( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.endchildren.php // ========== RECURSIVETREEITERATOR_ENDCHILDREN - END // SYNTAX: // void RecursiveTreeIterator::endChildren() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_ENDCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_ENDITERATION // ============================== PUBLIC // ============================== ABOUT // End iteration. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::endIteration() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_enditeration($recursivetreeiterator) { // ========== RECURSIVETREEITERATOR_ENDITERATION - BEGIN // ===== ABOUT // End iteration // ===== DESCRIPTION // Called when the iteration ends (when RecursiveTreeIterator::valid() first returns false) // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::endIteration(): void // ===== CODE $recursivetreeiterator->endIteration( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.enditeration.php // ========== RECURSIVETREEITERATOR_ENDITERATION - END // SYNTAX: // void RecursiveTreeIterator::endIteration() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_ENDITERATION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETENTRY // ============================== PUBLIC // ============================== ABOUT // Get current entry. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::getEntry() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_getentry($recursivetreeiterator) { $return_recursivetreeiterator_getentry = null; // ========== RECURSIVETREEITERATOR_GETENTRY - BEGIN // ===== ABOUT // Get current entry // ===== DESCRIPTION // Gets the part of the tree built for the current element. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::getEntry(): string // ===== CODE $return_recursivetreeiterator_getentry = $recursivetreeiterator->getEntry( // This function has no parameters. ); // Return Values // Returns the part of the tree built for the current element. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.getentry.php // ========== RECURSIVETREEITERATOR_GETENTRY - END // SYNTAX: // string RecursiveTreeIterator::getEntry() return $return_recursivetreeiterator_getentry; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETENTRY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETPOSTFIX // ============================== PUBLIC // ============================== ABOUT // Get the postfix. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::getPostfix() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_getpostfix($recursivetreeiterator) { $return_recursivetreeiterator_getpostfix = null; // ========== RECURSIVETREEITERATOR_GETPOSTFIX - BEGIN // ===== ABOUT // Get the postfix // ===== DESCRIPTION // Gets the string to place after the current element. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::getPostfix(): string // ===== CODE $return_recursivetreeiterator_getpostfix = $recursivetreeiterator->getPostfix( // This function has no parameters. ); // Return Values // Returns the string to place after the current element. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.getpostfix.php // ========== RECURSIVETREEITERATOR_GETPOSTFIX - END // SYNTAX: // string RecursiveTreeIterator::getPostfix() return $return_recursivetreeiterator_getpostfix; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETPOSTFIX // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETPREFIX // ============================== PUBLIC // ============================== ABOUT // Get the prefix. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::getPrefix() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_getprefix($recursivetreeiterator) { $return_recursivetreeiterator_getprefix = null; // ========== RECURSIVETREEITERATOR_GETPREFIX - BEGIN // ===== ABOUT // Get the prefix // ===== DESCRIPTION // Gets the string to place in front of current element // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::getPrefix(): string // ===== CODE $return_recursivetreeiterator_getprefix = $recursivetreeiterator->getPrefix( // This function has no parameters. ); // Return Values // Returns the string to place in front of current element // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.getprefix.php // ========== RECURSIVETREEITERATOR_GETPREFIX - END // SYNTAX: // string RecursiveTreeIterator::getPrefix() return $return_recursivetreeiterator_getprefix; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_GETPREFIX // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_KEY // ============================== PUBLIC // ============================== ABOUT // Get the key of the current element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::key() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_key($recursivetreeiterator) { $return_recursivetreeiterator_key = null; // ========== RECURSIVETREEITERATOR_KEY - BEGIN // ===== ABOUT // Get the key of the current element // ===== DESCRIPTION // Gets the current key prefixed and postfixed. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::key(): mixed // ===== CODE $return_recursivetreeiterator_key = $recursivetreeiterator->key( // This function has no parameters. ); // Return Values // Returns the current key prefixed and postfixed. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.key.php // ========== RECURSIVETREEITERATOR_KEY - END // SYNTAX: // mixed RecursiveTreeIterator::key() return $return_recursivetreeiterator_key; // mixed } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_NEXT // ============================== PUBLIC // ============================== ABOUT // Move to next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::next() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_next($recursivetreeiterator) { // ========== RECURSIVETREEITERATOR_NEXT - BEGIN // ===== ABOUT // Move to next element // ===== DESCRIPTION // Moves forward to the next element. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::next(): void // ===== CODE $recursivetreeiterator->next( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.next.php // ========== RECURSIVETREEITERATOR_NEXT - END // SYNTAX: // void RecursiveTreeIterator::next() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_NEXTELEMENT // ============================== PUBLIC // ============================== ABOUT // Next element. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::nextElement() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_nextelement($recursivetreeiterator) { // ========== RECURSIVETREEITERATOR_NEXTELEMENT - BEGIN // ===== ABOUT // Next element // ===== DESCRIPTION // Called when the next element is available. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::nextElement(): void // ===== CODE $recursivetreeiterator->nextElement( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.nextelement.php // ========== RECURSIVETREEITERATOR_NEXTELEMENT - END // SYNTAX: // void RecursiveTreeIterator::nextElement() // return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_NEXTELEMENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind iterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::rewind() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_rewind($recursivetreeiterator) { // ========== RECURSIVETREEITERATOR_REWIND - BEGIN // ===== ABOUT // Rewind iterator // ===== DESCRIPTION // Rewinds the iterator to the first element of the top level inner iterator. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::rewind(): void // ===== CODE $recursivetreeiterator->rewind( // This function has no parameters. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.rewind.php // ========== RECURSIVETREEITERATOR_REWIND - END // SYNTAX: // void RecursiveTreeIterator::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_SETPOSTFIX // ============================== PUBLIC // ============================== ABOUT // Set postfix. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::setPostfix() - PHP_5 >= PHP_5_5_3, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_setpostfix($recursivetreeiterator, $postfix) { // ========== RECURSIVETREEITERATOR_SETPOSTFIX - BEGIN // ===== ABOUT // Set postfix // ===== DESCRIPTION // Sets postfix as used in RecursiveTreeIterator::getPostfix(). // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_5_3, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::setPostfix(string $postfix): void // ===== CODE $recursivetreeiterator->setPostfix( $postfix // string postfix ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.setpostfix.php // ========== RECURSIVETREEITERATOR_SETPOSTFIX - END // SYNTAX: // void RecursiveTreeIterator::setPostfix(string $postfix) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_SETPOSTFIX // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_SETPREFIXPART // ============================== PUBLIC // ============================== ABOUT // Set a part of the prefix. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::setPrefixPart() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_setprefixpart($recursivetreeiterator, $part, $value) { // ========== RECURSIVETREEITERATOR_SETPREFIXPART - BEGIN // ===== ABOUT // Set a part of the prefix // ===== DESCRIPTION // Sets a part of the prefix used in the graphic tree. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::setPrefixPart(int $part, string $value): void // ===== CODE $recursivetreeiterator->setPrefixPart( $part, // int part - One of the RecursiveTreeIterator::PREFIX_* constants. $value // string value - The value to assign to the part of the prefix specified in part. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.setprefixpart.php // ========== RECURSIVETREEITERATOR_SETPREFIXPART - END // SYNTAX: // void RecursiveTreeIterator::setPrefixPart(int $part, string $value) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_SETPREFIXPART // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_VALID // ============================== PUBLIC // ============================== ABOUT // Check validity. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RecursiveTreeIterator::valid() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_recursivetreeiterator_valid($recursivetreeiterator) { $return_recursivetreeiterator_valid = false; // ========== RECURSIVETREEITERATOR_VALID - BEGIN // ===== ABOUT // Check validity // ===== DESCRIPTION // Check whether the current position is valid. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public RecursiveTreeIterator::valid(): bool // ===== CODE $return_recursivetreeiterator_valid = $recursivetreeiterator->valid( // This function has no parameters. ); // Return Values // true if the current position is valid, otherwise false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/recursivetreeiterator.valid.php // ========== RECURSIVETREEITERATOR_VALID - END // SYNTAX: // bool RecursiveTreeIterator::valid() return $return_recursivetreeiterator_valid; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR_VALID // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_RECURSIVETREEITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR // ============================== PUBLIC // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_ACCEPT - bool php_basic_spl_iterators_regexiterator_accept(RegexIterator $regexiterator) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_CONSTRUCT - RegexIterator php_basic_spl_iterators_regexiterator_construct(Iterator $iterator, string $pattern, int $mode = RegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETFLAGS - int php_basic_spl_iterators_regexiterator_getflags(RegexIterator $regexiterator) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETMODE - int php_basic_spl_iterators_regexiterator_getmode(RegexIterator $regexiterator) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETPREGFLAGS - int php_basic_spl_iterators_regexiterator_getpregflags(RegexIterator $regexiterator) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETREGEX - string php_basic_spl_iterators_regexiterator_getregex(RegexIterator $regexiterator) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETFLAGS - void php_basic_spl_iterators_regexiterator_setflags(RegexIterator $regexiterator, int $flags) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETMODE - void php_basic_spl_iterators_regexiterator_setmode(RegexIterator $regexiterator, int $mode) // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETPREGFLAGS - void php_basic_spl_iterators_regexiterator_setpregflags(RegexIterator $regexiterator, int $pregFlags) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (9) // RegexIterator::accept() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::__construct() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::getFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::getMode() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::getPregFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::getRegex() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // RegexIterator::setFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::setMode() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // RegexIterator::setPregFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (6) // bool // RegexIterator - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // Iterator - PHP_5, PHP_7, PHP_8 // string // int // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_ACCEPT // ============================== PUBLIC // ============================== ABOUT // Get accept status. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::accept() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_accept($regexiterator) { $return_regexiterator_accept = false; // ========== REGEXITERATOR_ACCEPT - BEGIN // ===== ABOUT // Get accept status // ===== DESCRIPTION // Matches (string) RegexIterator::current() (or RegexIterator::key() if the RegexIterator::USE_KEY flag is set) against the regular expression. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::accept(): bool // ===== CODE $return_regexiterator_accept = $regexiterator->accept( // This function has no parameters. ); // Return Values // true if a match, false otherwise. // // [examples] // Examples // [example] // Example #1 RegexIterator::accept() example // This example shows that only items matching the regular expression are accepted. // [php] // $names = new ArrayIterator(array('Ann', 'Bob', 'Charlie', 'David')); // $filter = new RegexIterator($names, '/^[B-D]/'); // foreach ($filter as $name) { // echo $name . PHP_EOL; // } // [/php] // The above example will output: // [result] // Bob // Charlie // David // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.accept.php // ========== REGEXITERATOR_ACCEPT - END // SYNTAX: // bool RegexIterator::accept() return $return_regexiterator_accept; // bool } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_ACCEPT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Create a new RegexIterator. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::__construct() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // RegexIterator::MATCH - RegexIterator::__construct() // ============================== CODE function php_basic_spl_iterators_regexiterator_construct($iterator, $pattern, $mode = RegexIterator::MATCH, $flags = 0, $pregFlags = 0) { $return_regexiterator_construct = null; // ========== REGEXITERATOR_CONSTRUCT - BEGIN // ===== ABOUT // Create a new RegexIterator // ===== DESCRIPTION // Create a new RegexIterator which filters an Iterator using a regular expression. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::__construct( // Iterator $iterator, // string $pattern, // int $mode = RegexIterator::MATCH, // int $flags = 0, // int $pregFlags = 0 // ) // ===== CODE $return_regexiterator_construct = new RegexIterator( $iterator, // Iterator iterator - The iterator to apply this regex filter to. $pattern, // string pattern - The regular expression to match. $mode, // int mode - Operation mode, see RegexIterator::setMode() for a list of modes. $flags, // int flags - Special flags, see RegexIterator::setFlags() for a list of available flags. $pregFlags // int pregFlags - The regular expression flags. These flags depend on the operation mode parameter: // // RegexIterator preg_flags // operation mode - available flags // RegexIterator::ALL_MATCHES - See preg_match_all(). // RegexIterator::GET_MATCH - See preg_match(). // RegexIterator::MATCH - See preg_match(). // RegexIterator::REPLACE - none. // RegexIterator::SPLIT - See preg_split(). ); // Return // RegexIterator // // Errors/Exceptions // Throws an InvalidArgumentException if the pattern argument is invalid. // // [examples] // Examples // [example] // Example #1 RegexIterator::__construct() example // Creates a new RegexIterator that filters all strings that start with 'test'. // [php] // $arrayIterator = new ArrayIterator(array('test 1', 'another test', 'test 123')); // $regexIterator = new RegexIterator($arrayIterator, '/^test/'); // // foreach ($regexIterator as $value) { // echo $value . "\n"; // } // [/php] // The above example will output something similar to: // [result] // test 1 // test 123 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.construct.php // ========== REGEXITERATOR_CONSTRUCT - END // SYNTAX: // RegexIterator RegexIterator::__construct(Iterator $iterator, string $pattern, int $mode = RegexIterator::MATCH, int $flags = 0, int $pregFlags = 0) return $return_regexiterator_construct; // RegexIterator } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Get flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::getFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_getflags($regexiterator) { $return_regexiterator_getflags = 0; // ========== REGEXITERATOR_GETFLAGS - BEGIN // ===== ABOUT // Get flags // ===== DESCRIPTION // Returns the flags, see RegexIterator::setFlags() for a list of available flags. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::getFlags(): int // ===== CODE $return_regexiterator_getflags = $regexiterator->getFlags( // This function has no parameters. ); // Return Values // Returns the set flags. // // [examples] // Examples // [example] // Example #1 RegexIterator::getFlags() example // [php] // // $test = array ('str1' => 'test 1', 'teststr2' => 'another test', 'str3' => 'test 123'); // // $arrayIterator = new ArrayIterator($test); // $regexIterator = new RegexIterator($arrayIterator, '/^test/'); // $regexIterator->setFlags(RegexIterator::USE_KEY); // // if ($regexIterator->getFlags() & RegexIterator::USE_KEY) { // echo 'Filtering based on the array keys.'; // } else { // echo 'Filtering based on the array values.'; // } // [/php] // The above example will output: // [result] // Filtering based on the array keys. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.getflags.php // ========== REGEXITERATOR_GETFLAGS - END // SYNTAX: // int RegexIterator::getFlags() return $return_regexiterator_getflags; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETMODE // ============================== PUBLIC // ============================== ABOUT // Returns operation mode. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::getMode() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_getmode($regexiterator) { $return_regexiterator_getmode = 0; // ========== REGEXITERATOR_GETMODE - BEGIN // ===== ABOUT // Returns operation mode // ===== DESCRIPTION // Returns the operation mode, see RegexIterator::setMode() for the list of operation modes. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::getMode(): int // ===== CODE $return_regexiterator_getmode = $regexiterator->getMode( // This function has no parameters. ); // Return Values // Returns the operation mode. // // [examples] // Examples // [example] // Example #1 RegexIterator::getMode() example // [php] // // $test = array ('str1' => 'test 1', 'teststr2' => 'another test', 'str3' => 'test 123'); // // $arrayIterator = new ArrayIterator($test); // $regexIterator = new RegexIterator($arrayIterator, '/^[a-z]+/', RegexIterator::GET_MATCH); // // $mode = $regexIterator->getMode(); // if ($mode & RegexIterator::GET_MATCH) { // echo 'Getting the match for each item.'; // } elseif ($mode & RegexIterator::ALL_MATCHES) { // echo 'Getting all matches for each item.'; // } elseif ($mode & RegexIterator::MATCH) { // echo 'Getting each item if it matches.'; // } elseif ($mode & RegexIterator::SPLIT) { // echo 'Getting split pieces of each.'; // } // [/php] // The above example will output: // [result] // Getting the match for each item. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.getmode.php // ========== REGEXITERATOR_GETMODE - END // SYNTAX: // int RegexIterator::getMode() return $return_regexiterator_getmode; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETMODE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETPREGFLAGS // ============================== PUBLIC // ============================== ABOUT // Returns the regular expression flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::getPregFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_getpregflags($regexiterator) { $return_regexiterator_getpregflags = 0; // ========== REGEXITERATOR_GETPREGFLAGS - BEGIN // ===== ABOUT // Returns the regular expression flags // ===== DESCRIPTION // Returns the regular expression flags, see RegexIterator::__construct() for the list of flags. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::getPregFlags(): int // ===== CODE $return_regexiterator_getpregflags = $regexiterator->getPregFlags( // This function has no parameters. ); // Return Values // Returns a bitmask of the regular expression flags. // // [examples] // Examples // [example] // Example #1 RegexIterator::getPregFlags() example // [php] // // $test = array ('str1' => 'test 1', 'teststr2' => 'another test', 'str3' => 'test 123'); // // $arrayIterator = new ArrayIterator($test); // $regexIterator = new RegexIterator($arrayIterator, '/\s/', RegexIterator::SPLIT); // $regexIterator->setPregFlags(PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE); // // if ($regexIterator->getPregFlags() & PREG_SPLIT_NO_EMPTY) { // echo 'Ignoring empty pieces'; // } else { // echo 'Not ignoring empty pieces'; // } // // [/php] // The above example will output: // [result] // Ignoring empty pieces // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.getpregflags.php // ========== REGEXITERATOR_GETPREGFLAGS - END // SYNTAX: // int RegexIterator::getPregFlags() return $return_regexiterator_getpregflags; // int } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETPREGFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETREGEX // ============================== PUBLIC // ============================== ABOUT // Returns current regular expression. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::getRegex() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_getregex($regexiterator) { $return_regexiterator_getregex = null; // ========== REGEXITERATOR_GETREGEX - BEGIN // ===== ABOUT // Returns current regular expression // ===== DESCRIPTION // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::getRegex(): string // ===== CODE $return_regexiterator_getregex = $regexiterator->getRegex( // This function has no parameters. ); // Return Values // string // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.getregex.php // ========== REGEXITERATOR_GETREGEX - END // SYNTAX: // string RegexIterator::getRegex() return $return_regexiterator_getregex; // string } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_GETREGEX // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets the flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::setFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_setflags($regexiterator, $flags) { // ========== REGEXITERATOR_SETFLAGS - BEGIN // ===== ABOUT // Sets the flags // ===== DESCRIPTION // Sets the flags. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::setFlags(int $flags): void // ===== CODE $regexiterator->setFlags( $flags // int flags - The flags to set, a bitmask of class constants. // The available flags are listed below. The actual meanings of these flags are described in the predefined constants. // // RegexIterator flags // value - constant // 1 - RegexIterator::USE_KEY ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 RegexIterator::setFlags() example // Creates a new RegexIterator that filters all entries whose key starts with 'test'. // [php] // $test = array ('str1' => 'test 1', 'teststr2' => 'another test', 'str3' => 'test 123'); // // $arrayIterator = new ArrayIterator($test); // $regexIterator = new RegexIterator($arrayIterator, '/^test/'); // $regexIterator->setFlags(RegexIterator::USE_KEY); // // foreach ($regexIterator as $key => $value) { // echo $key . ' => ' . $value . "\n"; // } // [/php] // The above example will output: // [result] // teststr2 => another test // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.setflags.php // ========== REGEXITERATOR_SETFLAGS - END // SYNTAX: // void RegexIterator::setFlags(int $flags) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETMODE // ============================== PUBLIC // ============================== ABOUT // Sets the operation mode. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::setMode() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_setmode($regexiterator, $mode) { // ========== REGEXITERATOR_SETMODE - BEGIN // ===== ABOUT // Sets the operation mode // ===== DESCRIPTION // Sets the operation mode. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::setMode(int $mode): void // ===== CODE $regexiterator->setMode( $mode // int mode - The operation mode. // The available modes are listed below. The actual meanings of these modes are described in the predefined constants. // // RegexIterator modes // value - constant // 0 - RegexIterator::MATCH // 1 - RegexIterator::GET_MATCH // 2 - RegexIterator::ALL_MATCHES // 3 - RegexIterator::SPLIT // 4 - RegexIterator::REPLACE ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 RegexIterator::setMode() example // [php] // $test = array ('str1' => 'test 1', 'test str2' => 'another test', 'str3' => 'test 123'); // // $arrayIterator = new ArrayIterator($test); // // Filter everything that starts with 'test ' followed by one or more numbers. // $regexIterator = new RegexIterator($arrayIterator, '/^test (\d+)/'); // // Operation mode: Replace actual value with the matches // $regexIterator->setMode(RegexIterator::GET_MATCH); // // foreach ($regexIterator as $key => $value) { // // print out the matched number(s) // echo $key . ' => ' . $value[1] . PHP_EOL; // } // [/php] // The above example will output something similar to: // [result] // str1 => 1 // str3 => 123 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.setmode.php // ========== REGEXITERATOR_SETMODE - END // SYNTAX: // void RegexIterator::setMode(int $mode) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETMODE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETPREGFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets the regular expression flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // RegexIterator::setPregFlags() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_iterators_regexiterator_setpregflags($regexiterator, $pregFlags) { // ========== REGEXITERATOR_SETPREGFLAGS - BEGIN // ===== ABOUT // Sets the regular expression flags // ===== DESCRIPTION // Sets the regular expression flags. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public RegexIterator::setPregFlags(int $pregFlags): void // ===== CODE $regexiterator->setPregFlags( $pregFlags // int pregFlags - The regular expression flags. See RegexIterator::__construct() for an overview of available flags. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 RegexIterator::setPregFlags() example // Creates a new RegexIterator that filters all entries with where the array key starts with 'test'. // [php] // $test = array ('test 1', 'another test', 'test 123'); // // $arrayIterator = new ArrayIterator($test); // $regexIterator = new RegexIterator($arrayIterator, '/^test/', RegexIterator::GET_MATCH); // // $regexIterator->setPregFlags(PREG_OFFSET_CAPTURE); // // foreach ($regexIterator as $key => $value) { // var_dump($value); // } // [/php] // The above example will output something similar to: // [result] // array(1) { // [0]=> // array(2) { // [0]=> // string(4) "test" // [1]=> // int(0) // } // } // array(1) { // [0]=> // array(2) { // [0]=> // string(4) "test" // [1]=> // int(0) // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/regexiterator.setpregflags.php // ========== REGEXITERATOR_SETPREGFLAGS - END // SYNTAX: // void RegexIterator::setPregFlags(int $pregFlags) // Return: void } // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR_SETPREGFLAGS // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS_REGEXITERATOR // ============================== // ============================== END // PHP_BASIC_SPL_ITERATORS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING // ============================== PUBLIC // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO // ============================== PUBLIC // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_CONSTRUCT - SplFileInfo php_basic_spl_filehandling_splfileinfo_construct(string $filename) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETATIME - int|false php_basic_spl_filehandling_splfileinfo_getatime(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETBASENAME - string php_basic_spl_filehandling_splfileinfo_getbasename(SplFileInfo $splfileinfo, string $suffix = "") // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETCTIME - int|false php_basic_spl_filehandling_splfileinfo_getctime(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETEXTENSION - string php_basic_spl_filehandling_splfileinfo_getextension(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETFILEINFO - SplFileInfo php_basic_spl_filehandling_splfileinfo_getfileinfo(SplFileInfo $splfileinfo, string $class = null) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETFILENAME - string php_basic_spl_filehandling_splfileinfo_getfilename(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETGROUP - int|false php_basic_spl_filehandling_splfileinfo_getgroup(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETINODE - int|false php_basic_spl_filehandling_splfileinfo_getinode(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETLINKTARGET - string|false php_basic_spl_filehandling_splfileinfo_getlinktarget(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETMTIME - int|false php_basic_spl_filehandling_splfileinfo_getmtime(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETOWNER - int|false php_basic_spl_filehandling_splfileinfo_getowner(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATH - string php_basic_spl_filehandling_splfileinfo_getpath(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATHINFO - SplFileInfo php_basic_spl_filehandling_splfileinfo_getpathinfo(SplFileInfo $splfileinfo, string $class = null) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATHNAME - string php_basic_spl_filehandling_splfileinfo_getpathname(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPERMS - int|false php_basic_spl_filehandling_splfileinfo_getperms(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETREALPATH - string|false php_basic_spl_filehandling_splfileinfo_getrealpath(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETSIZE - int|false php_basic_spl_filehandling_splfileinfo_getsize(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETTYPE - string|false php_basic_spl_filehandling_splfileinfo_gettype(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISDIR - bool php_basic_spl_filehandling_splfileinfo_isdir(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISEXECUTABLE - bool php_basic_spl_filehandling_splfileinfo_isexecutable(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISFILE - bool php_basic_spl_filehandling_splfileinfo_isfile(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISLINK - bool php_basic_spl_filehandling_splfileinfo_islink(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISREADABLE - bool php_basic_spl_filehandling_splfileinfo_isreadable(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISWRITABLE - bool php_basic_spl_filehandling_splfileinfo_iswritable(SplFileInfo $splfileinfo) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_OPENFILE - SplFileObject php_basic_spl_filehandling_splfileinfo_openfile(SplFileInfo $splfileinfo, string $mode = "r", bool $useIncludePath = false, resource $context = null) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_SETFILECLASS - void php_basic_spl_filehandling_splfileinfo_setfileclass(SplFileInfo $splfileinfo, string $class) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_SETINFOCLASS - void php_basic_spl_filehandling_splfileinfo_setinfoclass(SplFileInfo $splfileinfo, string $class) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_TOSTRING - string php_basic_spl_filehandling_splfileinfo_tostring(SplFileInfo $splfileinfo) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (29) // SplFileInfo::__construct() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getATime() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getBasename() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // SplFileInfo::getCTime() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getExtension() - PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // SplFileInfo::getFileInfo() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getFilename() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getGroup() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getInode() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getLinkTarget() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // SplFileInfo::getMTime() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getOwner() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getPath() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getPathInfo() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getPathname() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getPerms() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getRealPath() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // SplFileInfo::getSize() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::getType() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::isDir() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::isExecutable() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::isFile() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::isLink() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::isReadable() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::isWritable() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::openFile() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::setFileClass() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::setInfoClass() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileInfo::__toString() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== USING DATA_TYPES (8) // SplFileInfo - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // string // int // false // bool // SplFileObject - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // resource // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a new SplFileInfo object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::__construct() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_construct($filename) { $return_splfileinfo_construct = null; // ========== SPLFILEINFO_CONSTRUCT - BEGIN // ===== ABOUT // Construct a new SplFileInfo object // ===== DESCRIPTION // Creates a new SplFileInfo object for the file_name specified. The file does not need to exist, or be readable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::__construct(string $filename) // ===== CODE $return_splfileinfo_construct = new SplFileInfo( $filename // string filename - Path to the file. ); // Return // SplFileInfo // // [examples] // Examples // [example] // Example #1 SplFileInfo::__construct() example // [php] // $info = new SplFileInfo('example.php'); // if ($info->isFile()) { // echo $info->getRealPath(); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.construct.php // ========== SPLFILEINFO_CONSTRUCT - END // SYNTAX: // SplFileInfo SplFileInfo::__construct(string $filename) return $return_splfileinfo_construct; // SplFileInfo } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETATIME // ============================== PUBLIC // ============================== ABOUT // Gets last access time of the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getATime() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getatime($splfileinfo) { $return_splfileinfo_getatime = false; // ========== SPLFILEINFO_GETATIME - BEGIN // ===== ABOUT // Gets last access time of the file // ===== DESCRIPTION // Gets the last access time for the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getATime(): int|false // ===== CODE $return_splfileinfo_getatime = $splfileinfo->getATime( // This function has no parameters. ); // Return Values // Returns the time the file was last accessed on success, or false on failure. // // Errors/Exceptions // Throws RuntimeException on error. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getATime() example // [php] // $info = new SplFileInfo('example.jpg'); // echo 'Last accessed at ' . date('g:i a', $info->getATime()); // [/php] // The above example will output something similar to: // [result] // Last accessed at 1:49 pm // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getatime.php // ========== SPLFILEINFO_GETATIME - END // SYNTAX: // int|false SplFileInfo::getATime() return $return_splfileinfo_getatime; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETATIME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETBASENAME // ============================== PUBLIC // ============================== ABOUT // Gets the base name of the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getBasename() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getbasename($splfileinfo, $suffix = "") { $return_splfileinfo_getbasename = null; // ========== SPLFILEINFO_GETBASENAME - BEGIN // ===== ABOUT // Gets the base name of the file // ===== DESCRIPTION // This method returns the base name of the file, directory, or link without path info. // Caution: SplFileInfo::getBasename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getBasename(string $suffix = ""): string // ===== CODE $return_splfileinfo_getbasename = $splfileinfo->getBasename( $suffix // string suffix - Optional suffix to omit from the base name returned. ); // Return Values // Returns the base name without path information. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getBasename() example // [php] // $info = new SplFileInfo('file.txt'); // var_dump($info->getBasename()); // // $info = new SplFileInfo('/path/to/file.txt'); // var_dump($info->getBasename()); // // $info = new SplFileInfo('/path/to/file.txt'); // var_dump($info->getBasename('.txt')); // [/php] // The above example will output something similar to: // [result] // string(8) "file.txt" // string(8) "file.txt" // string(4) "file" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://php.net/manual/en/splfileinfo.getbasename.php // ========== SPLFILEINFO_GETBASENAME - END // SYNTAX: // string SplFileInfo::getBasename(string $suffix = "") return $return_splfileinfo_getbasename; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETBASENAME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETCTIME // ============================== PUBLIC // ============================== ABOUT // Gets the inode change time. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getCTime() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getctime($splfileinfo) { $return_splfileinfo_getctime = false; // ========== SPLFILEINFO_GETCTIME - BEGIN // ===== ABOUT // Gets the inode change time // ===== DESCRIPTION // Returns the inode change time for the file. The time returned is a Unix timestamp. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getCTime(): int|false // ===== CODE $return_splfileinfo_getctime = $splfileinfo->getCTime( // This function has no parameters. ); // Return Values // The last change time, in a Unix timestamp on success, or false on failure. // // Errors/Exceptions // Throws RuntimeException on error. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getCTime() example // [php] // $info = new SplFileInfo('example.jpg'); // echo 'Last changed at ' . date('g:i a', $info->getCTime()); // [/php] // The above example will output something similar to: // [result] // Last changed at 1:49 pm // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getctime.php // ========== SPLFILEINFO_GETCTIME - END // SYNTAX: // int|false SplFileInfo::getCTime() return $return_splfileinfo_getctime; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETCTIME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETEXTENSION // ============================== PUBLIC // ============================== ABOUT // Gets the file extension. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getExtension() - PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getextension($splfileinfo) { $return_splfileinfo_getextension = null; // ========== SPLFILEINFO_GETEXTENSION - BEGIN // ===== ABOUT // Gets the file extension // ===== DESCRIPTION // Retrieves the file extension. // ===== SUPPORTED // PHP_5 >= PHP_5_3_6, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getExtension(): string // ===== CODE $return_splfileinfo_getextension = $splfileinfo->getExtension( // This function has no parameters. ); // Return Values // Returns a string containing the file extension, or an empty string if the file has no extension. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getExtension() example // [php] // // $info = new SplFileInfo('foo.txt'); // var_dump($info->getExtension()); // // $info = new SplFileInfo('photo.jpg'); // var_dump($info->getExtension()); // // $info = new SplFileInfo('something.tar.gz'); // var_dump($info->getExtension()); // // [/php] // The above example will output: // [result] // string(3) "txt" // string(3) "jpg" // string(2) "gz" // [/result] // [/example] // [/examples] // // Notes // Note: // Another way of getting the extension is to use the pathinfo() function. // [php] // $extension = pathinfo($info->getFilename(), PATHINFO_EXTENSION); // [/php] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getextension.php // ========== SPLFILEINFO_GETEXTENSION - END // SYNTAX: // string SplFileInfo::getExtension() return $return_splfileinfo_getextension; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETEXTENSION // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETFILEINFO // ============================== PUBLIC // ============================== ABOUT // Gets an SplFileInfo object for the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getFileInfo() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getfileinfo($splfileinfo, $class = null) { $return_splfileinfo_getfileinfo = null; // ========== SPLFILEINFO_GETFILEINFO - BEGIN // ===== ABOUT // Gets an SplFileInfo object for the file // ===== DESCRIPTION // This method gets an SplFileInfo object for the referenced file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getFileInfo(?string $class = null): SplFileInfo // ===== CODE $return_splfileinfo_getfileinfo = $splfileinfo->getFileInfo( $class // string class - Name of an SplFileInfo derived class to use. ); // Return Values // An SplFileInfo object created for the file. // // Changelog // Version - Description // 8.0.0 - class is now nullable. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getfileinfo.php // ========== SPLFILEINFO_GETFILEINFO - END // SYNTAX: // SplFileInfo SplFileInfo::getFileInfo(string $class = null) return $return_splfileinfo_getfileinfo; // SplFileInfo } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETFILEINFO // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETFILENAME // ============================== PUBLIC // ============================== ABOUT // Gets the filename. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getFilename() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getfilename($splfileinfo) { $return_splfileinfo_getfilename = null; // ========== SPLFILEINFO_GETFILENAME - BEGIN // ===== ABOUT // Gets the filename // ===== DESCRIPTION // Gets the filename without any path information. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getFilename(): string // ===== CODE $return_splfileinfo_getfilename = $splfileinfo->getFilename( // This function has no parameters. ); // Return Values // The filename. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getFilename() example // [php] // $info = new SplFileInfo('foo.txt'); // var_dump($info->getFilename()); // // $info = new SplFileInfo('/path/to/foo.txt'); // var_dump($info->getFilename()); // // $info = new SplFileInfo('http://www.php.net/'); // var_dump($info->getFilename()); // // $info = new SplFileInfo('http://www.php.net/svn.php'); // var_dump($info->getFilename()); // [/php] // The above example will output something similar to: // [result] // string(7) "foo.txt" // string(7) "foo.txt" // string(0) "" // string(7) "svn.php" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getfilename.php // ========== SPLFILEINFO_GETFILENAME - END // SYNTAX: // string SplFileInfo::getFilename() return $return_splfileinfo_getfilename; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETFILENAME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETGROUP // ============================== PUBLIC // ============================== ABOUT // Gets the file group. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getGroup() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getgroup($splfileinfo) { $return_splfileinfo_getgroup = false; // ========== SPLFILEINFO_GETGROUP - BEGIN // ===== ABOUT // Gets the file group // ===== DESCRIPTION // Gets the file group. The group ID is returned in numerical format. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getGroup(): int|false // ===== CODE $return_splfileinfo_getgroup = $splfileinfo->getGroup( // This function has no parameters. ); // Return Values // The group id in numerical format on success, or false on failure. // // Errors/Exceptions // Throws RuntimeException on error. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getGroup() example // [php] // $info = new SplFileInfo('example.jpg'); // echo info->getFilename() . ' belongs to group id ' . $info->getGroup() . "\n"; // print_r(posix_getgrgid($info->getGroup())); // [/php] // The above example will output something similar to: // [result] // example.jpg belongs to group id 42 // Array // ( // [name] => toons // [passwd] => x // [members] => Array // ( // [0] => tom // [1] => jerry // ) // [gid] => 42 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getgroup.php // ========== SPLFILEINFO_GETGROUP - END // SYNTAX: // int|false SplFileInfo::getGroup() return $return_splfileinfo_getgroup; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETGROUP // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETINODE // ============================== PUBLIC // ============================== ABOUT // Gets the inode for the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getInode() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getinode($splfileinfo) { $return_splfileinfo_getinode = false; // ========== SPLFILEINFO_GETINODE - BEGIN // ===== ABOUT // Gets the inode for the file // ===== DESCRIPTION // Gets the inode number for the filesystem object. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getInode(): int|false // ===== CODE $return_splfileinfo_getinode = $splfileinfo->getInode( // This function has no parameters. ); // Return Values // Returns the inode number for the filesystem object on success, or false on failure. // // Errors/Exceptions // Throws RuntimeException on error. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getinode.php // ========== SPLFILEINFO_GETINODE - END // SYNTAX: // int|false SplFileInfo::getInode() return $return_splfileinfo_getinode; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETINODE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETLINKTARGET // ============================== PUBLIC // ============================== ABOUT // Gets the target of a link. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getLinkTarget() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getlinktarget($splfileinfo) { $return_splfileinfo_getlinktarget = false; // ========== SPLFILEINFO_GETLINKTARGET - BEGIN // ===== ABOUT // Gets the target of a link // ===== DESCRIPTION // Gets the target of a filesystem link. // Note: The target may not be the real path on the filesystem. Use SplFileInfo::getRealPath() to determine the true path on the filesystem. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getLinkTarget(): string|false // ===== CODE $return_splfileinfo_getlinktarget = $splfileinfo->getLinkTarget( // This function has no parameters. ); // Return Values // Returns the target of the filesystem link on success, or false on failure. // // Errors/Exceptions // Throws RuntimeException on error. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getLinkTarget() example // [php] // $info = new SplFileInfo('/Users/bbieber/workspace'); // if ($info->isLink()) { // var_dump($info->getLinkTarget()); // var_dump($info->getRealPath()); // } // [/php] // The above example will output something similar to: // [result] // string(19) "Documents/workspace" // string(34) "/Users/bbieber/Documents/workspace" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getlinktarget.php // ========== SPLFILEINFO_GETLINKTARGET - END // SYNTAX: // string|false SplFileInfo::getLinkTarget() return $return_splfileinfo_getlinktarget; // string|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETLINKTARGET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETMTIME // ============================== PUBLIC // ============================== ABOUT // Gets the last modified time. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getMTime() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getmtime($splfileinfo) { $return_splfileinfo_getmtime = false; // ========== SPLFILEINFO_GETMTIME - BEGIN // ===== ABOUT // Gets the last modified time // ===== DESCRIPTION // Returns the time when the contents of the file were changed. The time returned is a Unix timestamp. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getMTime(): int|false // ===== CODE $return_splfileinfo_getmtime = $splfileinfo->getMTime( // This function has no parameters. ); // Return Values // Returns the last modified time for the file, in a Unix timestamp on success, or false on failure. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getMTime() example // [php] // $info = new SplFileInfo('example.jpg'); // echo 'Last modified at ' . date('g:i a', $info->getMTime()); // [/php] // The above example will output something similar to: // [result] // Last modified at 1:49 pm // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getmtime.php // ========== SPLFILEINFO_GETMTIME - END // SYNTAX: // int|false SplFileInfo::getMTime() return $return_splfileinfo_getmtime; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETMTIME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETOWNER // ============================== PUBLIC // ============================== ABOUT // Gets the owner of the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getOwner() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getowner($splfileinfo) { $return_splfileinfo_getowner = false; // ========== SPLFILEINFO_GETOWNER - BEGIN // ===== ABOUT // Gets the owner of the file // ===== DESCRIPTION // Gets the file owner. The owner ID is returned in numerical format. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getOwner(): int|false // ===== CODE $return_splfileinfo_getowner = $splfileinfo->getOwner( // This function has no parameters. ); // Return Values // The owner id in numerical format on success, or false on failure. // // Errors/Exceptions // Throws RuntimeException on error. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getOwner() example // [php] // $info = new SplFileInfo('example.jpg'); // echo info->getFilename() . ' belongs to owner id ' . $info->getOwner() . "\n"; // print_r(posix_getpwuid($info->getOwner())); // [/php] // The above example will output something similar to: // [result] // example.jpg belongs to user id 501 // Array // ( // [name] => tom // [passwd] => x // [uid] => 501 // [gid] => 42 // [gecos] => Tom Cat // [dir] => /home/tom // [shell] => /bin/bash // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getowner.php // ========== SPLFILEINFO_GETOWNER - END // SYNTAX: // int|false SplFileInfo::getOwner() return $return_splfileinfo_getowner; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETOWNER // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATH // ============================== PUBLIC // ============================== ABOUT // Gets the path without filename. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getPath() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getpath($splfileinfo) { $return_splfileinfo_getpath = null; // ========== SPLFILEINFO_GETPATH - BEGIN // ===== ABOUT // Gets the path without filename // ===== DESCRIPTION // Returns the path to the file, omitting the filename and any trailing slash. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getPath(): string // ===== CODE $return_splfileinfo_getpath = $splfileinfo->getPath( // This function has no parameters. ); // Return Values // Returns the path to the file. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getPath() example // [php] // $info = new SplFileInfo('/usr/bin/php'); // var_dump($info->getPath()); // // // $info = new SplFileInfo('/usr/'); // var_dump($info->getPath()); // [/php] // The above example will output something similar to: // [result] // string(8) "/usr/bin" // string(4) "/usr" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getpath.php // ========== SPLFILEINFO_GETPATH - END // SYNTAX: // string SplFileInfo::getPath() return $return_splfileinfo_getpath; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATHINFO // ============================== PUBLIC // ============================== ABOUT // Gets an SplFileInfo object for the path. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getPathInfo() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getpathinfo($splfileinfo, $class = null) { $return_splfileinfo_getpathinfo = null; // ========== SPLFILEINFO_GETPATHINFO - BEGIN // ===== ABOUT // Gets an SplFileInfo object for the path // ===== DESCRIPTION // Gets an SplFileInfo object for the parent of the current file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getPathInfo(?string $class = null): ?SplFileInfo // ===== CODE $return_splfileinfo_getpathinfo = $splfileinfo->getPathInfo( $class // string class - Name of an SplFileInfo derived class to use, or itself if null. ); // Return Values // Returns an SplFileInfo object for the parent path of the file on success, or null on failure. // // Changelog // Version - Description // 8.0.0 - class is now nullable. // // [examples] // Examples // Example #1 SplFileInfo::getPathInfo() example // [example] // [php] // $info = new SplFileInfo('/usr/bin/php'); // $parent_info = $info->getPathInfo(); // var_dump($parent_info->getRealPath()); // [/php] // The above example will output something similar to: // [result] // string(8) "/usr/bin" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getpathinfo.php // ========== SPLFILEINFO_GETPATHINFO - END // SYNTAX: // SplFileInfo SplFileInfo::getPathInfo(string $class = null) return $return_splfileinfo_getpathinfo; // SplFileInfo } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATHINFO // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATHNAME // ============================== PUBLIC // ============================== ABOUT // Gets the path to the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getPathname() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getpathname($splfileinfo) { $return_splfileinfo_getpathname = null; // ========== SPLFILEINFO_GETPATHNAME - BEGIN // ===== ABOUT // Gets the path to the file // ===== DESCRIPTION // Returns the path to the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getPathname(): string // ===== CODE $return_splfileinfo_getpathname = $splfileinfo->getPathname( // This function has no parameters. ); // Return Values // The path to the file. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getPathname() example // [php] // $info = new SplFileInfo('/usr/bin/php'); // var_dump($info->getPathname()); // [/php] // The above example will output something similar to: // [result] // string(12) "/usr/bin/php" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getpathname.php // ========== SPLFILEINFO_GETPATHNAME - END // SYNTAX: // string SplFileInfo::getPathname() return $return_splfileinfo_getpathname; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPATHNAME // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPERMS // ============================== PUBLIC // ============================== ABOUT // Gets file permissions. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getPerms() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getperms($splfileinfo) { $return_splfileinfo_getperms = false; // ========== SPLFILEINFO_GETPERMS - BEGIN // ===== ABOUT // Gets file permissions // ===== DESCRIPTION // Gets the file permissions for the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getPerms(): int|false // ===== CODE $return_splfileinfo_getperms = $splfileinfo->getPerms( // This function has no parameters. ); // Return Values // Returns the file permissions on success, or false on failure. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getPerms() example // [php] // $info = new SplFileInfo('/tmp'); // echo substr(sprintf('%o', $info->getPerms()), -4); // // $info = new SplFileInfo(__FILE__); // echo substr(sprintf('%o', $info->getPerms()), -4); // [/php] // The above example will output something similar to: // [result] // 1777 // 0644 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getperms.php // ========== SPLFILEINFO_GETPERMS - END // SYNTAX: // int|false SplFileInfo::getPerms() return $return_splfileinfo_getperms; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETPERMS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETREALPATH // ============================== PUBLIC // ============================== ABOUT // Gets absolute path to file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getRealPath() - PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getrealpath($splfileinfo) { $return_splfileinfo_getrealpath = false; // ========== SPLFILEINFO_GETREALPATH - BEGIN // ===== ABOUT // Gets absolute path to file // ===== DESCRIPTION // This method expands all symbolic links, resolves relative references and returns the real path to the file. // ===== SUPPORTED // PHP_5 >= PHP_5_2_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getRealPath(): string|false // ===== CODE $return_splfileinfo_getrealpath = $splfileinfo->getRealPath( // This function has no parameters. ); // Return Values // Returns the path to the file, or false if the file does not exist. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getRealPath() example // [php] // $info = new SplFileInfo('/..//./../../'.__FILE__); // var_dump($info->getRealPath()); // // $info = new SplFileInfo('/tmp'); // var_dump($info->getRealPath()); // // $info = new SplFileInfo('/I/Do/Not/Exist'); // var_dump($info->getRealPath()); // // $info = new SplFileInfo('php://output'); // var_dump($info->getRealPath()); // // $info = new SplFileInfo(""); // var_dump($info->getRealPath()); // [/php] // The above example will output something similar to: // [result] // string(28) "/private/tmp/phptempfile.php" // string(12) "/private/tmp" // bool(false) // bool(false) // string(12) "/private/tmp" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getrealpath.php // ========== SPLFILEINFO_GETREALPATH - END // SYNTAX: // string|false SplFileInfo::getRealPath() return $return_splfileinfo_getrealpath; // string|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETREALPATH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETSIZE // ============================== PUBLIC // ============================== ABOUT // Gets file size. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getSize() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_getsize($splfileinfo) { $return_splfileinfo_getsize = false; // ========== SPLFILEINFO_GETSIZE - BEGIN // ===== ABOUT // Gets file size // ===== DESCRIPTION // Returns the filesize in bytes for the file referenced. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getSize(): int|false // ===== CODE $return_splfileinfo_getsize = $splfileinfo->getSize( // This function has no parameters. ); // Return Values // The filesize in bytes on success, or false on failure. // // Errors/Exceptions // A RuntimeException will be thrown if the file does not exist or an error occurs. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getSize() example // [php] // $info = new SplFileInfo('example.jpg'); // echo $fileinfo->getFilename() . " " . $fileinfo->getSize(); // [/php] // The above example will output something similar to: // [result] // example.jpg 15385 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.getsize.php // ========== SPLFILEINFO_GETSIZE - END // SYNTAX: // int|false SplFileInfo::getSize() return $return_splfileinfo_getsize; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETSIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETTYPE // ============================== PUBLIC // ============================== ABOUT // Gets file type. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::getType() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_gettype($splfileinfo) { $return_splfileinfo_gettype = false; // ========== SPLFILEINFO_GETTYPE - BEGIN // ===== ABOUT // Gets file type // ===== DESCRIPTION // Returns the type of the file referenced. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::getType(): string|false // ===== CODE $return_splfileinfo_gettype = $splfileinfo->getType( // This function has no parameters. ); // Return Values // A string representing the type of the entry. May be one of file, link, dir, block, fifo, char, socket, or unknown, or false on failure. // // Errors/Exceptions // Throws a RuntimeException on error. // // [examples] // Examples // [example] // Example #1 SplFileInfo::getType() example // [php] // // $info = new SplFileInfo(__FILE__); // echo $info->getType().PHP_EOL; // // $info = new SplFileInfo(dirname(__FILE__)); // echo $info->getType(); // // [/php] // The above example will output something similar to: // [result] // file // dir // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.gettype.php // ========== SPLFILEINFO_GETTYPE - END // SYNTAX: // string|false SplFileInfo::getType() return $return_splfileinfo_gettype; // string|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_GETTYPE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISDIR // ============================== PUBLIC // ============================== ABOUT // Tells if the file is a directory. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::isDir() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_isdir($splfileinfo) { $return_splfileinfo_isdir = false; // ========== SPLFILEINFO_ISDIR - BEGIN // ===== ABOUT // Tells if the file is a directory // ===== DESCRIPTION // This method can be used to determine if the file is a directory. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::isDir(): bool // ===== CODE $return_splfileinfo_isdir = $splfileinfo->isDir( // This function has no parameters. ); // Return Values // Returns true if a directory, false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileInfo::isDir() example // [php] // $d = new SplFileInfo(dirname(__FILE__)); // var_dump($d->isDir()); // // $d = new SplFileInfo(__FILE__); // var_dump($d->isDir()); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.isdir.php // ========== SPLFILEINFO_ISDIR - END // SYNTAX: // bool SplFileInfo::isDir() return $return_splfileinfo_isdir; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISDIR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISEXECUTABLE // ============================== PUBLIC // ============================== ABOUT // Tells if the file is executable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::isExecutable() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_isexecutable($splfileinfo) { $return_splfileinfo_isexecutable = false; // ========== SPLFILEINFO_ISEXECUTABLE - BEGIN // ===== ABOUT // Tells if the file is executable // ===== DESCRIPTION // Checks if the file is executable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::isExecutable(): bool // ===== CODE $return_splfileinfo_isexecutable = $splfileinfo->isExecutable( // This function has no parameters. ); // Return Values // Returns true if executable, false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileInfo::isExecutable() example // [php] // $info = new SplFileInfo('/usr/bin/php'); // var_dump($info->isExecutable()); // // $info = new SplFileInfo('/usr/bin'); // var_dump($info->isExecutable()); // // $info = new SplFileInfo('foo'); // var_dump($info->isExecutable()); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.isexecutable.php // ========== SPLFILEINFO_ISEXECUTABLE - END // SYNTAX: // bool SplFileInfo::isExecutable() return $return_splfileinfo_isexecutable; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISEXECUTABLE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISFILE // ============================== PUBLIC // ============================== ABOUT // Tells if the object references a regular file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::isFile() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_isfile($splfileinfo) { $return_splfileinfo_isfile = false; // ========== SPLFILEINFO_ISFILE - BEGIN // ===== ABOUT // Tells if the object references a regular file // ===== DESCRIPTION // Checks if the file referenced by this SplFileInfo object exists and is a regular file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::isFile(): bool // ===== CODE $return_splfileinfo_isfile = $splfileinfo->isFile( // This function has no parameters. ); // Return Values // Returns true if the file exists and is a regular file (not a link), false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileInfo::isFile() example // [php] // $info = new SplFileInfo(__FILE__); // var_dump($info->isFile()); // // $info = new SplFileInfo(dirname(__FILE__)); // var_dump($info->isFile()); // [/php] // The above example will output something similar to: // [result] // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.isfile.php // ========== SPLFILEINFO_ISFILE - END // SYNTAX: // bool SplFileInfo::isFile() return $return_splfileinfo_isfile; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISFILE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISLINK // ============================== PUBLIC // ============================== ABOUT // Tells if the file is a link. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::isLink() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_islink($splfileinfo) { $return_splfileinfo_islink = false; // ========== SPLFILEINFO_ISLINK - BEGIN // ===== ABOUT // Tells if the file is a link // ===== DESCRIPTION // Use this method to check if the file referenced by the SplFileInfo object is a link. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::isLink(): bool // ===== CODE $return_splfileinfo_islink = $splfileinfo->isLink( // This function has no parameters. ); // Return Values // Returns true if the file is a link, false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileInfo::isLink() example // [php] // $info = new SplFileInfo('/path/to/symlink'); // if ($info->isLink()) { // echo 'The real path is '.$info->getRealPath(); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.islink.php // ========== SPLFILEINFO_ISLINK - END // SYNTAX: // bool SplFileInfo::isLink() return $return_splfileinfo_islink; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISLINK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISREADABLE // ============================== PUBLIC // ============================== ABOUT // Tells if file is readable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::isReadable() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_isreadable($splfileinfo) { $return_splfileinfo_isreadable = false; // ========== SPLFILEINFO_ISREADABLE - BEGIN // ===== ABOUT // Tells if file is readable // ===== DESCRIPTION // Check if the file is readable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::isReadable(): bool // ===== CODE $return_splfileinfo_isreadable = $splfileinfo->isReadable( // This function has no parameters. ); // Return Values // Returns true if readable, false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileInfo::isReadable() example // [php] // $info = new SplFileInfo('readable.jpg'); // if ($info->isReadable()) { // echo $info->getFilename() . ' is readable'; // } // [/php] // The above example will output something similar to: // [result] // readable.jpg is readable // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.isreadable.php // ========== SPLFILEINFO_ISREADABLE - END // SYNTAX: // bool SplFileInfo::isReadable() return $return_splfileinfo_isreadable; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISREADABLE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISWRITABLE // ============================== PUBLIC // ============================== ABOUT // Tells if the entry is writable. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::isWritable() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_iswritable($splfileinfo) { $return_splfileinfo_iswritable = false; // ========== SPLFILEINFO_ISWRITABLE - BEGIN // ===== ABOUT // Tells if the entry is writable // ===== DESCRIPTION // Checks if the current entry is writable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::isWritable(): bool // ===== CODE $return_splfileinfo_iswritable = $splfileinfo->isWritable( // This function has no parameters. ); // Return Values // Returns true if writable, false otherwise; // // [examples] // Examples // [example] // Example #1 SplFileInfo::isWriteable() example // [php] // $info = new SplFileInfo('locked.jpg'); // if (!$info->isWriteable()) { // echo $info->getFilename() . ' is not writeable'; // } // [/php] // The above example will output something similar to: // [result] // locked.jpg is not writeable // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.iswritable.php // ========== SPLFILEINFO_ISWRITABLE - END // SYNTAX: // bool SplFileInfo::isWritable() return $return_splfileinfo_iswritable; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_ISWRITABLE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_OPENFILE // ============================== PUBLIC // ============================== ABOUT // Gets an SplFileObject object for the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::openFile() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_openfile($splfileinfo, $mode = "r", $useIncludePath = false, $context = null) { $return_splfileinfo_openfile = null; // ========== SPLFILEINFO_OPENFILE - BEGIN // ===== ABOUT // Gets an SplFileObject object for the file // ===== DESCRIPTION // Creates an SplFileObject object of the file. This is useful because SplFileObject contains additional methods for manipulating the file whereas SplFileInfo is only useful for gaining information, like whether the file is writable. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObject // ===== CODE $return_splfileinfo_openfile = $splfileinfo->openFile( $mode, // string mode - The mode for opening the file. See the fopen() documentation for descriptions of possible modes. The default is read only. $useIncludePath, // bool useIncludePath - When set to true, the filename is also searched for within the include_path $context // resource context - Refer to the context section of the manual for a description of contexts. ); // Return Values // The opened file as an SplFileObject object. // // Errors/Exceptions // A RuntimeException if the file cannot be opened (e.g. insufficient access rights). // // Changelog // Version - Description // 8.0.0 - context is now nullable. // // [examples] // Examples // [example] // Example #1 SplFileInfo::openFile() example // [php] // $fileinfo = new SplFileInfo('/tmp/foo.txt'); // // if ($fileinfo->isWritable()) { // // $fileobj = $fileinfo->openFile('a'); // // $fileobj->fwrite("appended this sample text"); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.openfile.php // ========== SPLFILEINFO_OPENFILE - END // SYNTAX: // SplFileObject SplFileInfo::openFile(string $mode = "r", bool $useIncludePath = false, resource $context = null) return $return_splfileinfo_openfile; // SplFileObject } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_OPENFILE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_SETFILECLASS // ============================== PUBLIC // ============================== ABOUT // Sets the class used with SplFileInfo::openFile(). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::setFileClass() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_setfileclass($splfileinfo, $class) { // ========== SPLFILEINFO_SETFILECLASS - BEGIN // ===== ABOUT // Sets the class used with SplFileInfo::openFile() // ===== DESCRIPTION // Use this method to set a custom class which will be used when SplFileInfo::openFile() is called. The class name passed to this method must be SplFileObject or a class derived from SplFileObject. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::setFileClass(string $class = SplFileObject::class): void // ===== CODE $splfileinfo->setFileClass( $class // string class - The class name to use when SplFileInfo::openFile() is called. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplFileInfo::setFileClass() example // [php] // // Create a class extending SplFileObject // class MyFoo extends SplFileObject {} // // $info = new SplFileInfo(__FILE__); // // Set the class to use // $info->setFileClass('MyFoo'); // var_dump($info->openFile()); // [/php] // The above example will output something similar to: // [result] // object(MyFoo)#2 (0) { } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.setfileclass.php // ========== SPLFILEINFO_SETFILECLASS - END // SYNTAX: // void SplFileInfo::setFileClass(string $class) // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_SETFILECLASS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_SETINFOCLASS // ============================== PUBLIC // ============================== ABOUT // Sets the class used with SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo(). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::setInfoClass() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_setinfoclass($splfileinfo, $class) { // ========== SPLFILEINFO_SETINFOCLASS - BEGIN // ===== ABOUT // Sets the class used with SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() // ===== DESCRIPTION // Use this method to set a custom class which will be used when SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() are called. The class name passed to this method must be SplFileInfo or a class derived from SplFileInfo. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void // ===== CODE $splfileinfo->setInfoClass( $class // string class - The class name to use when SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() are called. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplFileInfo::setFileClass() example // [php] // // Define a class which extends SplFileInfo // class MyFoo extends SplFileInfo {} // // $info = new SplFileInfo('foo'); // // Set the class name to use // $info->setInfoClass('MyFoo'); // var_dump($info->getFileInfo()); // [/php] // The above example will output something similar to: // [result] // object(MyFoo)#2 (0) { } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.setinfoclass.php // ========== SPLFILEINFO_SETINFOCLASS - END // SYNTAX: // void SplFileInfo::setInfoClass(string $class) // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_SETINFOCLASS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Returns the path to the file as a string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileInfo::__toString() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileinfo_tostring($splfileinfo) { $return_splfileinfo_tostring = null; // ========== SPLFILEINFO_TOSTRING - BEGIN // ===== ABOUT // Returns the path to the file as a string // ===== DESCRIPTION // This method will return the file name of the referenced file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileInfo::__toString(): string // ===== CODE $return_splfileinfo_tostring = $splfileinfo->__toString( // This function has no parameters. ); // Return Values // Returns the path to the file. // // [examples] // Examples // [example] // Example #1 SplFileInfo::__toString() example // [php] // $info = new SplFileInfo('foo'); // var_dump($info->__toString()); // echo $info.PHP_EOL; // // $info = new SplFileInfo('/usr/bin/php'); // var_dump($info->__toString()); // echo $info.PHP_EOL; // [/php] // The above example will output something similar to: // [result] // string(3) "foo" // foo // string(12) "/usr/bin/php" // /usr/bin/php // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileinfo.tostring.php // ========== SPLFILEINFO_TOSTRING - END // SYNTAX: // string SplFileInfo::__toString() return $return_splfileinfo_tostring; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO_TOSTRING // ============================== // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEINFO // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT // ============================== PUBLIC // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_CONSTRUCT - SplFileObject php_basic_spl_filehandling_splfileobject_construct(string $filename, string $mode = "r", bool $useIncludePath = false, resource $context = null) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_CURRENT - string|array|false php_basic_spl_filehandling_splfileobject_current(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_EOF - bool php_basic_spl_filehandling_splfileobject_eof(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FFLUSH - bool php_basic_spl_filehandling_splfileobject_fflush(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETC - string|false php_basic_spl_filehandling_splfileobject_fgetc(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETCSV - array|false php_basic_spl_filehandling_splfileobject_fgetcsv(SplFileObject $splfileobject, string $separator = ",", string $enclosure = "\"", string $escape = "\\") // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETS - string php_basic_spl_filehandling_splfileobject_fgets(SplFileObject $splfileobject) // OFFLINE | PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETSS - string php_basic_spl_filehandling_splfileobject_fgetss(SplFileObject $splfileobject, string $allowable_tags) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FLOCK - bool php_basic_spl_filehandling_splfileobject_flock(int $operation, int& $wouldBlock = null) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FPASSTHRU - int php_basic_spl_filehandling_splfileobject_fpassthru(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FPUTCSV - int|false php_basic_spl_filehandling_splfileobject_fputcsv(SplFileObject $splfileobject, array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n") // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FREAD - string|false php_basic_spl_filehandling_splfileobject_fread(SplFileObject $splfileobject, int $length) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSCANF - array|int|null php_basic_spl_filehandling_splfileobject_fscanf(SplFileObject $splfileobject, string $format, mixed& $vars) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSEEK - int php_basic_spl_filehandling_splfileobject_fseek(SplFileObject $splfileobject, int $offset, int $whence = SEEK_SET) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSTAT - array php_basic_spl_filehandling_splfileobject_fstat(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FTELL - int|false php_basic_spl_filehandling_splfileobject_ftell(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FTRUNCATE - bool php_basic_spl_filehandling_splfileobject_ftruncate(SplFileObject $splfileobject, int $size) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FWRITE - int|false php_basic_spl_filehandling_splfileobject_fwrite(SplFileObject $splfileobject, string $data, int $length = 0) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCHILDREN - null php_basic_spl_filehandling_splfileobject_getchildren(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCSVCONTROL - array php_basic_spl_filehandling_splfileobject_getcsvcontrol(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCURRENTLINE - string php_basic_spl_filehandling_splfileobject_getcurrentline(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETFLAGS - int php_basic_spl_filehandling_splfileobject_getflags(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETMAXLINELEN - int php_basic_spl_filehandling_splfileobject_getmaxlinelen(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_HASCHILDREN - bool php_basic_spl_filehandling_splfileobject_haschildren(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_KEY - int php_basic_spl_filehandling_splfileobject_key(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_NEXT - void php_basic_spl_filehandling_splfileobject_next(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_REWIND - void php_basic_spl_filehandling_splfileobject_rewind(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SEEK - void php_basic_spl_filehandling_splfileobject_seek(SplFileObject $splfileobject, int $line) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETCSVCONTROL - void php_basic_spl_filehandling_splfileobject_setcsvcontrol(string $separator = ",", string $enclosure = "\"", string $escape = "\\") // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETFLAGS - void php_basic_spl_filehandling_splfileobject_setflags(SplFileObject $splfileobject, int $flags) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETMAXLINELEN - void php_basic_spl_filehandling_splfileobject_setmaxlinelen(SplFileObject $splfileobject, int $maxLength) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_TOSTRING - string php_basic_spl_filehandling_splfileobject_tostring(SplFileObject $splfileobject) // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_VALID - bool php_basic_spl_filehandling_splfileobject_valid(SplFileObject $splfileobject) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (33) // SplFileObject::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::eof() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fflush() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fgetc() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fgetcsv() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fgets() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // OFFLINE | SplFileObject::fgetss() - PHP_5 >= PHP_5_1_0, PHP_7 // SplFileObject::flock() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fpassthru() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fputcsv() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // SplFileObject::fread() - PHP_5 >= PHP_5_5_11, PHP_7, PHP_8 // SplFileObject::fscanf() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fseek() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fstat() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::ftell() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::ftruncate() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::fwrite() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::getCsvControl() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // SplFileObject::getCurrentLine() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileObject::getFlags() - PHP_5 >= 5_1_0, PHP_7, PHP_8 // SplFileObject::getMaxLineLen() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::hasChildren() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // SplFileObject::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::seek() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::setCsvControl() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // SplFileObject::setFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::setMaxLineLen() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::__toString() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // SplFileObject::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (10) // SplFileObject - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // string // bool // resource // array // false // int // null // mixed // void // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a new file object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::__construct() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_construct($filename, $mode = "r", $useIncludePath = false, $context = null) { $return_splfileobject_construct = null; // ========== SPLFILEOBJECT_CONSTRUCT - BEGIN // ===== ABOUT // Construct a new file object // ===== DESCRIPTION // Construct a new file object. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::__construct( // string $filename, // string $mode = "r", // bool $useIncludePath = false, // ?resource $context = null // ) // ===== CODE $return_splfileobject_construct = new SplFileObject( $filename, // string filename - The file to read. // Tip: A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide. $mode, // string mode - The mode in which to open the file. See fopen() for a list of allowed modes. $useIncludePath, // bool useIncludePath - Whether to search in the include_path for filename. $context // resource context - A valid context resource created with stream_context_create(). ); // Return // SplFileObject // // Errors/Exceptions // Throws a RuntimeException if the filename cannot be opened. // Throws a LogicException if the filename is a directory. // // [examples] // Examples // [example] // Example #1 SplFileObject::__construct() example // This example opens the current file and iterates over its contents line by line. // [php] // $file = new SplFileObject(__FILE__); // foreach ($file as $line_num => $line) { // echo "Line $line_num is $line"; // } // [/php] // The above example will output something similar to: // [result] // Line 0 is [php] // Line 1 is $file = new SplFileObject(__FILE__); // Line 2 is foreach ($file as $line_num => $line) { // Line 3 is echo "Line $line_num is $line"; // Line 4 is } // Line 5 is[/php] // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.construct.php // ========== SPLFILEOBJECT_CONSTRUCT - END // SYNTAX: // SplFileObject SplFileObject::__construct(string $filename, string $mode = "r", bool $useIncludePath = false, resource $context = null) return $return_splfileobject_construct; // SplFileObject } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_CURRENT // ============================== PUBLIC // ============================== ABOUT // Retrieve current line of file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::current() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_current($splfileobject) { // ========== FILEHANDLING_CURRENT - BEGIN // ===== ABOUT // Retrieve current line of file // ===== DESCRIPTION // Retrieves the current line of the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::current(): string|array|false // ===== CODE $splfileobject->current( // This function has no parameters. ); // Return Values // Retrieves the current line of the file. If the SplFileObject::READ_CSV flag is set, this method returns an array containing the current line parsed as CSV data. If the end of the file is reached, false is returned. // // [examples] // Examples // [example] // Example #1 SplFileObject::current() example // [php] // $file = new SplFileObject(__FILE__); // foreach ($file as $k => $line) { // echo ($file->key() + 1) . ': ' . $file->current(); // } // [/php] // The above example will output something similar to: // [result] // 1: [php] // 2: $file = new SplFileObject(__FILE__); // 3: foreach ($file as $line) { // 4: echo ($file->key() + 1) . ': ' . $file->current(); // 5: } // 6: [/php] // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.current.php // ========== FILEHANDLING_CURRENT - END // SYNTAX: // string|array|false SplFileObject::current() // Return: string|array|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_CURRENT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_EOF // ============================== PUBLIC // ============================== ABOUT // Reached end of file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::eof() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_eof($splfileobject) { $return_splfileobject_eof = false; // ========== SPLFILEOBJECT_EOF - BEGIN // ===== ABOUT // Reached end of file // ===== DESCRIPTION // Determine whether the end of file has been reached // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::eof(): bool // ===== CODE $return_splfileobject_eof = $splfileobject->eof( // This function has no parameters. ); // Return Values // Returns true if file is at EOF, false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileObject::eof() example // [php] // $file = new SplFileObject("fruits.txt"); // while ( ! $file->eof()) { // echo $file->fgets(); // } // [/php] // The above example will output something similar to: // [result] // apple // banana // cherry // date // elderberry // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.eof.php // ========== SPLFILEOBJECT_EOF - END // SYNTAX: // bool SplFileObject::eof() return $return_splfileobject_eof; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_EOF // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FFLUSH // ============================== PUBLIC // ============================== ABOUT // Flushes the output to the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fflush() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fflush($splfileobject) { $return_splfileobject_fflush = false; // ========== SPLFILEOBJECT_FFLUSH - BEGIN // ===== ABOUT // Flushes the output to the file // ===== DESCRIPTION // Forces a write of all buffered output to the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fflush(): bool // ===== CODE $return_splfileobject_fflush = $splfileobject->fflush( // This function has no parameters. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 SplFileObject::fflush() example // [php] // $file = new SplFileObject('misc.txt', 'r+'); // $file->rewind(); // $file->fwrite("Foo"); // $file->fflush(); // $file->ftruncate($file->ftell()); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fflush.php // ========== SPLFILEOBJECT_FFLUSH - END // SYNTAX: // bool SplFileObject::fflush() return $return_splfileobject_fflush; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FFLUSH // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETC // ============================== PUBLIC // ============================== ABOUT // Gets character from file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fgetc() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fgetc($splfileobject) { $return_splfileobject_fgetc = false; // ========== SPLFILEOBJECT_FGETC - BEGIN // ===== ABOUT // Gets character from file // ===== DESCRIPTION // Gets a character from the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fgetc(): string|false // ===== CODE $return_splfileobject_fgetc = $splfileobject->fgetc( // This function has no parameters. ); // Return Values // Returns a string containing a single character read from the file or false on EOF. // Warning: This function may return Boolean false, but may also return a non-Boolean value which evaluates to false. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. // // [examples] // Examples // [example] // Example #1 SplFileObject::fgetc() example // [php] // $file = new SplFileObject('file.txt'); // while (false !== ($char = $file->fgetc())) { // echo "$char\n"; // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fgetc.php // ========== SPLFILEOBJECT_FGETC - END // SYNTAX: // string|false SplFileObject::fgetc() return $return_splfileobject_fgetc; // string|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETC // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETCSV // ============================== PUBLIC // ============================== ABOUT // Gets line from file and parse as CSV fields. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fgetcsv() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fgetcsv($splfileobject, $separator = ",", $enclosure = "\"", $escape = "\\") { $return_splfileobject_fgetcsv = false; // ========== SPLFILEOBJECT_FGETCSV - BEGIN // ===== ABOUT // Gets line from file and parse as CSV fields // ===== DESCRIPTION // Gets a line from the file which is in CSV format and returns an array containing the fields read. // Note: The locale settings are taken into account by this function. If LC_CTYPE is e.g. en_US.UTF-8, files in one-byte encodings may be read wrongly by this function. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fgetcsv(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false // ===== CODE $return_splfileobject_fgetcsv = $splfileobject->fgetcsv( $separator, // string separator - The field delimiter (one single-byte character only). Defaults as a comma or the value set using SplFileObject::setCsvControl(). $enclosure, // string enclosure - The field enclosure character (one single-byte character only). Defaults as a double quotation mark or the value set using SplFileObject::setCsvControl(). $escape // string escape - The escape character (at most one single-byte character). Defaults as a backslash (\) or the value set using SplFileObject::setCsvControl(). An empty string ("") disables the proprietary escape mechanism. // Note: Usually an enclosure character is escaped inside a field by doubling it; however, the escape character can be used as an alternative. So for the default parameter values "" and \" have the same meaning. Other than allowing to escape the enclosure character the escape character has no special meaning; it isn't even meant to escape itself. ); // Return Values // Returns an indexed array containing the fields read, or false on error. // Note: A blank line in a CSV file will be returned as an array comprising a single null field unless using SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE, in which case empty lines are skipped. // // Changelog // Version - Description // 7.4.0 - The escape parameter now also accepts an empty string to disable the proprietary escape mechanism. // // [examples] // Examples // [example] // Example #1 SplFileObject::fgetcsv() example // [php] // $file = new SplFileObject("data.csv"); // while (!$file->eof()) { // var_dump($file->fgetcsv()); // } // [/php] // [/example] // [example] // Example #2 SplFileObject::READ_CSV example // [php] // $file = new SplFileObject("data.csv"); // while (!$file->eof()) { // var_dump($file->fgetcsv()); // } // [/php] // Contents of animals.csv // [result] // crocodile,reptile,4 // dolphin,mammal,0 // duck,bird,2 // koala,mammal,4 // salmon,fish,0 // [/result] // The above example will output something similar to: // [result] // A crocodile is a reptile with 4 legs // A dolphin is a mammal with 0 legs // A duck is a bird with 2 legs // A koala is a mammal with 4 legs // A salmon is a fish with 0 legs // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fgetcsv.php // ========== SPLFILEOBJECT_FGETCSV - END // SYNTAX: // array|false SplFileObject::fgetcsv(string $separator = ",", string $enclosure = "\"", string $escape = "\\") return $return_splfileobject_fgetcsv; // array|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETCSV // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETS // ============================== PUBLIC // ============================== ABOUT // Gets line from file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fgets() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fgets($splfileobject) { $return_splfileobject_fgets = null; // ========== SPLFILEOBJECT_FGETS - BEGIN // ===== ABOUT // Gets line from file // ===== DESCRIPTION // Gets a line from the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fgets(): string // ===== CODE $return_splfileobject_fgets = $splfileobject->fgets( // This function has no parameters. ); // Return Values // Returns a string containing the next line from the file. // // Errors/Exceptions // Throws a RuntimeException if the file cannot be read. // // [examples] // Examples // [example] // Example #1 SplFileObject::fgets() example // This example simply outputs the contents of file.txt line-by-line. // [php] // $file = new SplFileObject("file.txt"); // while (!$file->eof()) { // echo $file->fgets(); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fgets.php // ========== SPLFILEOBJECT_FGETS - END // SYNTAX: // string SplFileObject::fgets() return $return_splfileobject_fgets; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETSS // ============================== OFFLINE // ============================== ABOUT // Gets line from file and strip HTML tags. // // Warning: This function has been DEPRECATED as of PHP 7.3.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ============================== SUPPORT // PHP_5 - PHP_7 // ============================== USING SUBCLASSES (1) // SplFileObject::fgetss() - PHP_5 >= PHP_5_1_0, PHP_7 // ============================== CODE /* function php_basic_spl_filehandling_splfileobject_fgetss($splfileobject, $allowable_tags) { $return_splfileobject_fgetss = null; // ========== SPLFILEOBJECT_FGETSS - BEGIN // ===== ABOUT // Gets line from file and strip HTML tags // Warning: This function has been DEPRECATED as of PHP 7.3.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. // ===== DESCRIPTION // Identical to SplFileObject::fgets(), except that SplFileObject::fgetss() attempts to strip any HTML and PHP tags from the text it reads. The function retains the parsing state from call to call, and as such is not equivalent to calling strip_tags() on the return value of SplFileObject::fgets(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7 // ===== SYNTAX // public SplFileObject::fgetss(string $allowable_tags = ?): string // ===== CODE $return_splfileobject_fgetss = $splfileobject->fgetss( $allowable_tags // string allowable_tags - Optional parameter to specify tags which should not be stripped. ); // Return Values // Returns a string containing the next line of the file with HTML and PHP code stripped, or false on error. // // [examples] // Examples // [example] // Example #1 SplFileObject::fgetss() example // [php] // $str = << //

Welcome! Today is the [php] echo(date('jS')); [/php] of [code]= date('F'); [/code].

// // Text outside of the HTML block. // EOD; // file_put_contents("sample.php", $str); // // $file = new SplFileObject("sample.php"); // while (!$file->eof()) { // echo $file->fgetss(); // } // [/php] // The above example will output something similar to: // [result] // // Welcome! Today is the of . // // Text outside of the HTML block. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fgetss.php // ========== SPLFILEOBJECT_FGETSS - END // SYNTAX: // string SplFileObject::fgetss(string $allowable_tags) return $return_splfileobject_fgetss; // string } */ // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FGETSS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FLOCK // ============================== PUBLIC // ============================== ABOUT // Portable file locking. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::flock() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_flock($operation, & $wouldBlock = null) { $return_splfileobject_flock = false; // ========== SPLFILEOBJECT_FLOCK - BEGIN // ===== ABOUT // Portable file locking // ===== DESCRIPTION // Locks or unlocks the file in the same portable way as flock(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::flock(int $operation, int &$wouldBlock = null): bool // ===== CODE $return_splfileobject_flock = $splfileobject->flock( $operation, // int operation - operation is one of the following: // * LOCK_SH to acquire a shared lock (reader). // * LOCK_EX to acquire an exclusive lock (writer). // * LOCK_UN to release a lock (shared or exclusive). // It is also possible to add LOCK_NB as a bitmask to one of the above operations, if flock() should not block during the locking attempt. $wouldBlock // int& wouldBlock - Set to true if the lock would block (EWOULDBLOCK errno condition). ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 SplFileObject::flock() example // [php] // $file = new SplFileObject("/tmp/lock.txt", "w"); // if ($file->flock(LOCK_EX)) { // do an exclusive lock // $file->ftruncate(0); // truncate file // $file->fwrite("Write something here\n"); // $file->flock(LOCK_UN); // release the lock // } else { // echo "Couldn't get the lock!"; // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.flock.php // ========== SPLFILEOBJECT_FLOCK - END // SYNTAX: // bool SplFileObject::flock(int $operation, int& $wouldBlock = null) return $return_splfileobject_flock; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FLOCK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FPASSTHRU // ============================== PUBLIC // ============================== ABOUT // Output all remaining data on a file pointer. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fpassthru() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fpassthru($splfileobject) { $return_splfileobject_fpassthru = 0; // ========== SPLFILEOBJECT_FPASSTHRU - BEGIN // ===== ABOUT // Output all remaining data on a file pointer // ===== DESCRIPTION // Reads to EOF on the given file pointer from the current position and writes the results to the output buffer. // You may need to call SplFileObject::rewind() to reset the file pointer to the beginning of the file if you have already written data to the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fpassthru(): int // ===== CODE $return_splfileobject_fpassthru = $splfileobject->fpassthru( // This function has no parameters. ); // Return Values // Returns the number of characters read from handle and passed through to the output. // // [examples] // Examples // [example] // Example #1 SplFileObject::fpassthru() example // [php] // // // Open the file in binary mode // $file = new SplFileObject("./img/ok.png", "rb"); // // // Send the right headers // header("Content-Type: image/png"); // header("Content-Length: " . $file->getSize()); // // // Dump the picture and end script // $file->fpassthru(); // exit; // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fpassthru.php // ========== SPLFILEOBJECT_FPASSTHRU - END // SYNTAX: // int SplFileObject::fpassthru() return $return_splfileobject_fpassthru; // int } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FPASSTHRU // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FPUTCSV // ============================== PUBLIC // ============================== ABOUT // Write a field array as a CSV line. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fputcsv() - PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fputcsv($splfileobject, $fields, $separator = ",", $enclosure = "\"", $escape = "\\", $eol = "\n") { $return_splfileobject_fputcsv = false; // ========== SPLFILEOBJECT_FPUTCSV - BEGIN // ===== ABOUT // Write a field array as a CSV line. // ===== DESCRIPTION // Writes the fields array to the file as a CSV line. // ===== SUPPORTED // PHP_5 >= PHP_5_4_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fputcsv( // array $fields, // string $separator = ",", // string $enclosure = "\"", // string $escape = "\\", // string $eol = "\n" // ): int|false // ===== CODE $return_splfileobject_fputcsv = $splfileobject->fputcsv( $fields, // array fields - An array of values. $separator, // string separator - The optional separator parameter sets the field delimiter (one single-byte character only). $enclosure, // string enclosure - The optional enclosure parameter sets the field enclosure (one single-byte character only). $escape, // string escape - The optional escape parameter sets the escape character (at most one single-byte character). An empty string ("") disables the proprietary escape mechanism. $eol // string eol - The optional eol parameter sets a custom End of Line sequence. // Note: If an enclosure character is contained in a field, it will be escaped by doubling it, unless it is immediately preceded by an escape. ); // Return Values // Returns the length of the written string or false on failure. // Returns false, and does not write the CSV line to the file, if the separator or enclosure parameter is not a single character. // // Errors/Exceptions // An E_WARNING level error is issued if the separator or enclosure parameter is not a single character. // // Changelog // Version - Description // 8.1.0 - The optional eol parameter has been added. // 7.4.0 - The escape parameter now also accepts an empty string to disable the proprietary escape mechanism. // // [examples] // Examples // [example] // Example #1 SplFileObject::fputcsv() example // [php] // // $list = array ( // array('aaa', 'bbb', 'ccc', 'dddd'), // array('123', '456', '789'), // array('"aaa"', '"bbb"') // ); // // $file = new SplFileObject('file.csv', 'w'); // // foreach ($list as $fields) { // $file->fputcsv($fields); // } // // [/php] // The above example will write the following to file.csv: // [result] // aaa,bbb,ccc,dddd // 123,456,789 // """aaa""","""bbb""" // // [/result] // [/example] // [/examples] // // Notes // Note: Note that SplFileObject::fread() reads from the current position of the file pointer. Use SplFileObject::ftell() to find the current position of the pointer and SplFileObject::rewind() (or SplFileObject::fseek()) to rewind the pointer position. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fputcsv.php // ========== SPLFILEOBJECT_FPUTCSV - END // SYNTAX: // int|false SplFileObject::fputcsv(array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n") return $return_splfileobject_fputcsv; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FPUTCSV // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FREAD // ============================== PUBLIC // ============================== ABOUT // Read from file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fread() - PHP_5 >= PHP_5_5_11, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fread($splfileobject, $length) { $return_splfileobject_fread = false; // ========== SPLFILEOBJECT_FREAD - BEGIN // ===== ABOUT // Read from file // ===== DESCRIPTION // Reads the given number of bytes from the file. // ===== SUPPORTED // PHP_5 >= PHP_5_5_11, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fread(int $length): string|false // ===== CODE $return_splfileobject_fread = $splfileobject->fread( $length // int length - The number of bytes to read. ); // Return Values // Returns the string read from the file or false on failure. // // [examples] // Examples // [example] // Example #1 SplFileObject::fread() example // [php] // // Get contents of a file into a string // $filename = "/usr/local/something.txt"; // $file = new SplFileObject($filename, "r"); // $contents = $file->fread($file->getSize()); // [/php] // [example] // [/examples] // // Notes // Note: Note that SplFileObject::fread() reads from the current position of the file pointer. Use SplFileObject::ftell() to find the current position of the pointer and SplFileObject::rewind() (or SplFileObject::fseek()) to rewind the pointer position. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fread.php // ========== SPLFILEOBJECT_FREAD - END // SYNTAX: // string|false SplFileObject::fread(int $length) return $return_splfileobject_fread; // string|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FREAD // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSCANF // ============================== PUBLIC // ============================== ABOUT // Parses input from file according to a format. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fscanf() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fscanf($splfileobject, $format, & $vars) { $return_splfileobject_fscanf = null; // ========== SPLFILEOBJECT_FSCANF - BEGIN // ===== ABOUT // Parses input from file according to a format // ===== DESCRIPTION // Reads a line from the file and interprets it according to the specified format. // Any whitespace in the format string matches any whitespace in the line from the file. This means that even a tab (\t) in the format string can match a single space character in the input stream. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fscanf(string $format, mixed &...$vars): array|int|null // ===== CODE $return_splfileobject_fscanf = $splfileobject->fscanf( $format, // string format - The interpreted format for string, which is described in the documentation for sprintf() with following differences: // * Function is not locale-aware. // * F, g, G and b are not supported. // * D stands for decimal number. // * i stands for integer with base detection. // * n stands for number of characters processed so far. // * s stops reading at any whitespace character. // * * instead of argnum$ suppresses the assignment of this conversion specification. $vars // mixed& vars - The optional assigned values. ); // Return Values // If only one parameter is passed to this method, the values parsed will be returned as an array. Otherwise, if optional parameters are passed, the function will return the number of assigned values. The optional parameters must be passed by reference. // // [examples] // Examples // [example] // Example #1 SplFileObject::fscanf() example // [php] // $file = new SplFileObject("misc.txt"); // while ($userinfo = $file->fscanf("%s %s %s")) { // list ($name, $profession, $countrycode) = $userinfo; // // Do something with $name $profession $countrycode // } // [/php] // Contents of users.txt // [result] // javier argonaut pe // hiroshi sculptor jp // robert slacker us // luigi florist it // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fscanf.php // ========== SPLFILEOBJECT_FSCANF - END // SYNTAX: // array|int|null SplFileObject::fscanf(string $format, mixed& $vars) return $return_splfileobject_fscanf; // array|int|null } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSCANF // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSEEK // ============================== PUBLIC // ============================== ABOUT // Seek to a position. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fseek() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // SEEK_SET - SplFileObject::fseek() // ============================== CODE function php_basic_spl_filehandling_splfileobject_fseek($splfileobject, $offset, $whence = SEEK_SET) { $return_splfileobject_fseek = 0; // ========== SPLFILEOBJECT_FSEEK - BEGIN // ===== ABOUT // Seek to a position // ===== DESCRIPTION // Seek to a position in the file measured in bytes from the beginning of the file, obtained by adding offset to the position specified by whence. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fseek(int $offset, int $whence = SEEK_SET): int // ===== CODE $return_splfileobject_fseek = $splfileobject->fseek( $offset, // int offset - The offset. A negative value can be used to move backwards through the file which is useful when SEEK_END is used as the whence value. $whence // int whence - whence values are: // * SEEK_SET - Set position equal to offset bytes. // * SEEK_CUR - Set position to current location plus offset. // * SEEK_END - Set position to end-of-file plus offset. // If whence is not specified, it is assumed to be SEEK_SET. ); // Return Values // Returns 0 if the seek was successful, -1 otherwise. Note that seeking past EOF is not considered an error. // // [examples] // Examples // [example] // Example #1 SplFileObject::fseek() example // [php] // $file = new SplFileObject("somefile.txt"); // // // Read first line // $data = $file->fgets(); // // // Move back to the beginning of the file // // Same as $file->rewind(); // $file->fseek(0); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fseek.php // ========== SPLFILEOBJECT_FSEEK - END // SYNTAX: // int SplFileObject::fseek(int $offset, int $whence = SEEK_SET) return $return_splfileobject_fseek; // int } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSEEK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSTAT // ============================== PUBLIC // ============================== ABOUT // Gets information about the file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fstat() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fstat($splfileobject) { $return_splfileobject_fstat = null; // ========== SPLFILEOBJECT_FSTAT - BEGIN // ===== ABOUT // Gets information about the file // ===== DESCRIPTION // Gathers the statistics of the file. Behaves identically to fstat(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fstat(): array // ===== CODE $return_splfileobject_fstat = $splfileobject->fstat( // This function has no parameters. ); // Return Values // Returns an array with the statistics of the file; the format of the array is described in detail on the stat() manual page. // // [examples] // Examples // [example] // Example #1 SplFileObject::fstat() example // [php] // $file = new SplFileObject("/etc/passwd"); // $stat = $file->fstat(); // // // Print only the associative part // print_r(array_slice($stat, 13)); // // [/php] // The above example will output something similar to: // [result] // Array // ( // [dev] => 771 // [ino] => 488704 // [mode] => 33188 // [nlink] => 1 // [uid] => 0 // [gid] => 0 // [rdev] => 0 // [size] => 1114 // [atime] => 1061067181 // [mtime] => 1056136526 // [ctime] => 1056136526 // [blksize] => 4096 // [blocks] => 8 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fstat.php // ========== SPLFILEOBJECT_FSTAT - END // SYNTAX: // array SplFileObject::fstat() return $return_splfileobject_fstat; // array } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FSTAT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FTELL // ============================== PUBLIC // ============================== ABOUT // Return current file position. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::ftell() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_ftell($splfileobject) { $return_splfileobject_ftell = false; // ========== SPLFILEOBJECT_FTELL - BEGIN // ===== ABOUT // Return current file position // ===== DESCRIPTION // Returns the position of the file pointer which represents the current offset in the file stream. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::ftell(): int|false // ===== CODE $return_splfileobject_ftell = $splfileobject->ftell( // This function has no parameters. ); // Return Values // Returns the position of the file pointer as an integer, or false on error. // // [examples] // Examples // [example] // Example #1 SplFileObject::ftell() example // [php] // $file = new SplFileObject("/etc/passwd"); // // // Read first line // $data = $file->fgets(); // // // Where are we? // echo $file->ftell(); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.ftell.php // ========== SPLFILEOBJECT_FTELL - END // SYNTAX: // int|false SplFileObject::ftell() return $return_splfileobject_ftell; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FTELL // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FTRUNCATE // ============================== PUBLIC // ============================== ABOUT // Truncates the file to a given length. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::ftruncate() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_ftruncate($splfileobject, $size) { $return_splfileobject_ftruncate = false; // ========== SPLFILEOBJECT_FTRUNCATE - BEGIN // ===== ABOUT // Truncates the file to a given length // ===== DESCRIPTION // Truncates the file to size bytes. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::ftruncate(int $size): bool // ===== CODE $return_splfileobject_ftruncate = $splfileobject->ftruncate( $size // int size - The size to truncate to. // Note: // If size is larger than the file it is extended with null bytes. // If size is smaller than the file, the extra data will be lost. ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 SplFileObject::ftruncate() example // [php] // // Create file containing "Hello World!" // $file = new SplFileObject("/tmp/ftruncate", "w+"); // $file->fwrite("Hello World!"); // // // Truncate to 5 bytes // $file->ftruncate(5); // // // Rewind and read data // $file->rewind(); // echo $file->fgets(); // [/php] // The above example will output something similar to: // [result] // Hello // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.ftruncate.php // ========== SPLFILEOBJECT_FTRUNCATE - END // SYNTAX: // bool SplFileObject::ftruncate(int $size) return $return_splfileobject_ftruncate; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FTRUNCATE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FWRITE // ============================== PUBLIC // ============================== ABOUT // Write to file. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::fwrite() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_fwrite($splfileobject, $data, $length = 0) { $return_splfileobject_fwrite = false; // ========== SPLFILEOBJECT_FWRITE - BEGIN // ===== ABOUT // Write to file // ===== DESCRIPTION // Writes the contents of string to the file // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fwrite(string $data, int $length = 0): int|false // ===== CODE $return_splfileobject_fwrite = $splfileobject->fwrite( $data, // string data - The string to be written to the file. $length // int length - If the length argument is given, writing will stop after length bytes have been written or the end of string is reached, whichever comes first. ); // Return Values // Returns the number of bytes written, or false on error. // // Changelog // Version - Description // 7.4.0 - The function now returns false instead of zero on failure. // // [examples] // Examples // [example] // Example #1 SplFileObject::fwrite() example // [php] // $file = new SplFileObject("fwrite.txt", "w"); // $written = $file->fwrite("12345"); // echo "Wrote $written bytes to file"; // [/php] // The above example will output something similar to: // [result] // Wrote 5 bytes to file // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fwrite.php // ========== SPLFILEOBJECT_FWRITE - END // SYNTAX: // int|false SplFileObject::fwrite(string $data, int $length = 0) return $return_splfileobject_fwrite; // int|false } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_FWRITE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCHILDREN // ============================== PUBLIC // ============================== ABOUT // No purpose. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::getChildren() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_getchildren($splfileobject) { $return_splfileobject_getchildren = null; // ========== SPLFILEOBJECT_GETCHILDREN - BEGIN // ===== ABOUT // No purpose // ===== DESCRIPTION // An SplFileObject does not have children so this method returns null. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::getChildren(): null // ===== CODE $return_splfileobject_getchildren = $splfileobject->getChildren( // This function has no parameters. ); // Return Values // Returns null. // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.getchildren.php // ========== SPLFILEOBJECT_GETCHILDREN - END // SYNTAX: // null SplFileObject::getChildren() return $return_splfileobject_getchildren; // null } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCSVCONTROL // ============================== PUBLIC // ============================== ABOUT // Get the delimiter, enclosure and escape character for CSV. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::getCsvControl() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_getcsvcontrol($splfileobject) { $return_splfileobject_getcsvcontrol = null; // ========== SPLFILEOBJECT_GETCSVCONTROL - BEGIN // ===== ABOUT // Get the delimiter, enclosure and escape character for CSV // ===== DESCRIPTION // Gets the delimiter, enclosure and escape character used for parsing CSV fields. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::getCsvControl(): array // ===== CODE $return_splfileobject_getcsvcontrol = $splfileobject->getCsvControl( // This function has no parameters. ); // Return Values // Returns an indexed array containing the delimiter, enclosure and escape character. // // Changelog // Version - Description // 7.4.0 - The escape character can now be an empty string. // 7.0.10 - Added the escape character to the returned array. // // [examples] // Examples // [example] // Example #1 SplFileObject::getCsvControl() example // [php] // $file = new SplFileObject("data.txt"); // print_r($file->getCsvControl()); // [/php] // The above example will output something similar to: // [result] // Array // ( // [0] => , // [1] => " // [2] => \ // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.getcsvcontrol.php // ========== SPLFILEOBJECT_GETCSVCONTROL - END // SYNTAX: // array SplFileObject::getCsvControl() return $return_splfileobject_getcsvcontrol; // array } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCSVCONTROL // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCURRENTLINE // ============================== PUBLIC // ============================== ABOUT // Gets line from file. // // SplFileObject::getCurrentLine - Alias of SplFileObject::fgets(). // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::getCurrentLine() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_getcurrentline($splfileobject) { $return_splfileobject_getcurrentline = null; // ========== SPLFILEOBJECT_GETCURRENTLINE - BEGIN // ===== ABOUT // SplFileObject::getCurrentLine - Alias of SplFileObject::fgets() // ===== DESCRIPTION // This method is an alias of: SplFileObject::fgets(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // ===== CODE $return_splfileobject_getcurrentline = $splfileobject->getCurrentLine( // This function has no parameters. ); // Return // string // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.getcurrentline.php // ========== SPLFILEOBJECT_GETCURRENTLINE - END // ========== SPLFILEOBJECT_FGETS - BEGIN // ===== ABOUT // Gets line from file // ===== DESCRIPTION // Gets a line from the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::fgets(): string // ===== CODE // $return_splfileobject_fgets = $splfileobject->fgets( // This function has no parameters. // ); // Return Values // Returns a string containing the next line from the file. // // Errors/Exceptions // Throws a RuntimeException if the file cannot be read. // // [examples] // Examples // [example] // Example #1 SplFileObject::fgets() example // This example simply outputs the contents of file.txt line-by-line. // [php] // $file = new SplFileObject("file.txt"); // while (!$file->eof()) { // echo $file->fgets(); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.fgets.php // ========== SPLFILEOBJECT_FGETS - END // SYNTAX: // string SplFileObject::getCurrentLine() return $return_splfileobject_getcurrentline; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETCURRENTLINE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Gets flags for the SplFileObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::getFlags() - PHP_5 >= 5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_getflags($splfileobject) { $return_splfileobject_getflags = 0; // ========== SPLFILEOBJECT_GETFLAGS - BEGIN // ===== ABOUT // Gets flags for the SplFileObject // ===== DESCRIPTION // Gets the flags set for an instance of SplFileObject as an int. // ===== SUPPORTED // PHP_5 >= 5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::getFlags(): int // ===== CODE $return_splfileobject_getflags = $splfileobject->getFlags( // This function has no parameters. ); // Return Values // Returns an int representing the flags. // // [examples] // Examples // [example] // Example #1 SplFileObject::getFlags() example // [php] // $file = new SplFileObject(__FILE__, "r"); // // if ($file->getFlags() & SplFileObject::SKIP_EMPTY) { // echo "Skipping empty lines\n"; // } else { // echo "Not skipping empty lines\n"; // } // // $file->setFlags(SplFileObject::SKIP_EMPTY); // // if ($file->getFlags() & SplFileObject::SKIP_EMPTY) { // echo "Skipping empty lines\n"; // } else { // echo "Not skipping empty lines\n"; // } // [/php] // The above example will output something similar to: // [result] // Not skipping empty lines // Skipping empty lines // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.getflags.php // ========== SPLFILEOBJECT_GETFLAGS - END // SYNTAX: // int SplFileObject::getFlags() return $return_splfileobject_getflags; // int } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETMAXLINELEN // ============================== PUBLIC // ============================== ABOUT // Get maximum line length. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::getMaxLineLen() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_getmaxlinelen($splfileobject) { $return_splfileobject_getmaxlinelen = 0; // ========== SPLFILEOBJECT_GETMAXLINELEN - BEGIN // ===== ABOUT // Get maximum line length // ===== DESCRIPTION // Gets the maximum line length as set by SplFileObject::setMaxLineLen(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::getMaxLineLen(): int // ===== CODE $return_splfileobject_getmaxlinelen = $splfileobject->getMaxLineLen( // This function has no parameters. ); // Return Values // Returns the maximum line length if one has been set with SplFileObject::setMaxLineLen(), default is 0. // // [examples] // Examples // [example] // Example #1 SplFileObject::getMaxLineLen() example // [php] // $file = new SplFileObject("file.txt"); // var_dump($file->getMaxLineLen()); // // $file->setMaxLineLen(20); // var_dump($file->getMaxLineLen()); // [/php] // The above example will output something similar to: // [result] // int(0) // int(20) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.getmaxlinelen.php // ========== SPLFILEOBJECT_GETMAXLINELEN - END // SYNTAX: // int SplFileObject::getMaxLineLen() return $return_splfileobject_getmaxlinelen; // int } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_GETMAXLINELEN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_HASCHILDREN // ============================== PUBLIC // ============================== ABOUT // SplFileObject does not have children. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::hasChildren() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_haschildren($splfileobject) { $return_splfileobject_haschildren = false; // ========== SPLFILEOBJECT_HASCHILDREN - BEGIN // ===== ABOUT // SplFileObject does not have children // ===== DESCRIPTION // An SplFileObject does not have children so this method always return false. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::hasChildren(): false // ===== CODE $return_splfileobject_haschildren = $splfileobject->hasChildren( // This function has no parameters. ); // Return Values // Returns false // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.haschildren.php // ========== SPLFILEOBJECT_HASCHILDREN - END // SYNTAX: // bool SplFileObject::hasChildren() return $return_splfileobject_haschildren; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_HASCHILDREN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_KEY // ============================== PUBLIC // ============================== ABOUT // Get line number. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::key() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_key($splfileobject) { $return_splfileobject_key = 0; // ========== SPLFILEOBJECT_KEY - BEGIN // ===== ABOUT // Get line number // ===== DESCRIPTION // Gets the current line number. // Note: This number may not reflect the actual line number in the file if SplFileObject::setMaxLineLen() is used to read fixed lengths of the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::key(): int // ===== CODE $return_splfileobject_key = $splfileobject->key( // This function has no parameters. ); // Return Values // Returns the current line number. // // [examples] // Examples // [example] // Example #1 SplFileObject::key() example // [php] // $file = new SplFileObject("lipsum.txt"); // foreach ($file as $line) { // echo $file->key() . ". " . $line; // } // [/php] // The above example will output something similar to: // [result] // 0. Lorem ipsum dolor sit amet, consectetur adipiscing elit. // 1. Duis nec sapien felis, ac sodales nisl. // 2. Lorem ipsum dolor sit amet, consectetur adipiscing elit. // [/result] // [/example] // [example] // Example #2 SplFileObject::key() example with SplFileObject::setMaxLineLen() // [php] // $file = new SplFileObject("lipsum.txt"); // $file->setMaxLineLen(20); // foreach ($file as $line) { // echo $file->key() . ". " . $line . "\n"; // } // [/php] // The above example will output something similar to: // [result] // 0. Lorem ipsum dolor s // 1. it amet, consectetu // 2. r adipiscing elit. // 3. // // 4. Duis nec sapien fel // 5. is, ac sodales nisl // 6. . // // 7. Lorem ipsum dolor s // 8. it amet, consectetu // 9. r adipiscing elit. // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.key.php // ========== SPLFILEOBJECT_KEY - END // SYNTAX: // int SplFileObject::key() return $return_splfileobject_key; // int } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_KEY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_NEXT // ============================== PUBLIC // ============================== ABOUT // Read next line. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::next() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_next($splfileobject) { // ========== SPLFILEOBJECT_NEXT - BEGIN // ===== ABOUT // Read next line // ===== DESCRIPTION // Moves ahead to the next line in the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::next(): void // ===== CODE $splfileobject->next( // This function has no parameters. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplFileObject::next() example // [php] // // Read through file line by line // $file = new SplFileObject("misc.txt"); // while (!$file->eof()) { // echo $file->current(); // $file->next(); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.next.php // ========== SPLFILEOBJECT_NEXT - END // SYNTAX: // void SplFileObject::next() // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_NEXT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_REWIND // ============================== PUBLIC // ============================== ABOUT // Rewind the file to the first line. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::rewind() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_rewind($splfileobject) { // ========== SPLFILEOBJECT_REWIND - BEGIN // ===== ABOUT // Rewind the file to the first line // ===== DESCRIPTION // Rewinds the file back to the first line. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::rewind(): void // ===== CODE $splfileobject->rewind( // This function has no parameters. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws a RuntimeException if cannot be rewound. // // [examples] // Examples // [example] // Example #1 SplFileObject::rewind() example // [php] // $file = new SplFileObject("misc.txt"); // // // Loop over whole file // foreach ($file as $line) { } // // // Rewind to first line // $file->rewind(); // // // Output first line // echo $file->current(); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.rewind.php // ========== SPLFILEOBJECT_REWIND - END // SYNTAX: // void SplFileObject::rewind() // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_REWIND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SEEK // ============================== PUBLIC // ============================== ABOUT // Seek to specified line. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::seek() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_seek($splfileobject, $line) { // ========== SPLFILEOBJECT_SEEK - BEGIN // ===== ABOUT // Seek to specified line // ===== DESCRIPTION // Seek to specified line in the file. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::seek(int $line): void // ===== CODE $splfileobject->seek( $line // int line - The zero-based line number to seek to. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws a LogicException if the line is negative. // // [examples] // Examples // [example] // Example #1 SplFileObject::seek() example // This example outputs the third line of the script which is found at position 2. // [php] // $file = new SplFileObject(__FILE__); // $file->seek(2); // echo $file->current(); // [/php] // The above example will output something similar to: // [result] // $file->seek(2); // // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.seek.php // ========== SPLFILEOBJECT_SEEK - END // SYNTAX: // void SplFileObject::seek(int $line) // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SEEK // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETCSVCONTROL // ============================== PUBLIC // ============================== ABOUT // Set the delimiter, enclosure and escape character for CSV. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::setCsvControl() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_setcsvcontrol($separator = ",", $enclosure = "\"", $escape = "\\") { // ========== SPLFILEOBJECT_SETCSVCONTROL - BEGIN // ===== ABOUT // Set the delimiter, enclosure and escape character for CSV // ===== DESCRIPTION // Sets the delimiter, enclosure and escape character for parsing CSV fields. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::setCsvControl(string $separator = ",", string $enclosure = "\"", string $escape = "\\"): void // ===== CODE $splfileobject->setCsvControl( $separator, // string separator - The field delimiter (one single-byte character only). $enclosure, // string enclosure - The field enclosure character (one single-byte character only). $escape // string escape - The field escape character (at most one single-byte character). An empty string ("") disables the proprietary escape mechanism. ); // Return Values // No value is returned. // // Changelog // Version - Description // 7.4.0 - The escape parameter now also accepts an empty string to disable the proprietary escape mechanism. // // [examples] // Examples // [example] // Example #1 SplFileObject::setCsvControl() example // [php] // $file = new SplFileObject("data.csv"); // $file->setFlags(SplFileObject::READ_CSV); // $file->setCsvControl('|'); // foreach ($file as $row) { // list ($fruit, $quantity) = $row; // // Do something with values // } // [/php] // Contents of data.csv // [result] // [php] // apples|20 // bananas|14 // cherries|87 // [/php] // [/result] // [/example] // [examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.setcsvcontrol.php // ========== SPLFILEOBJECT_SETCSVCONTROL - END // SYNTAX: // void SplFileObject::setCsvControl(string $separator = ",", string $enclosure = "\"", string $escape = "\\") // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETCSVCONTROL // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets flags for the SplFileObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::setFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_setflags($splfileobject, $flags) { // ========== SPLFILEOBJECT_SETFLAGS - BEGIN // ===== ABOUT // Sets flags for the SplFileObject // ===== DESCRIPTION // Sets the flags to be used by the SplFileObject. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::setFlags(int $flags): void // ===== CODE $splfileobject->setFlags( $flags // int flags - Bit mask of the flags to set. See SplFileObject constants for the available flags. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 SplFileObject::setFlags() example // [php] // $file = new SplFileObject("data.csv"); // $file->setFlags(SplFileObject::READ_CSV); // foreach ($file as $fields) { // var_dump($fields); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.setflags.php // ========== SPLFILEOBJECT_SETFLAGS - END // SYNTAX: // void SplFileObject::setFlags(int $flags) // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETMAXLINELEN // ============================== PUBLIC // ============================== ABOUT // Set maximum line length. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::setMaxLineLen() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_setmaxlinelen($splfileobject, $maxLength) { // ========== SPLFILEOBJECT_SETMAXLINELEN - BEGIN // ===== ABOUT // Set maximum line length // ===== DESCRIPTION // Sets the maximum length of a line to be read. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::setMaxLineLen(int $maxLength): void // ===== CODE $splfileobject->SplFileObject( $maxLength // int maxLength - The maximum length of a line. ); // Return Values // No value is returned. // // Errors/Exceptions // Throws DomainException when maxLength is less than zero. // // [examples] // Examples // [example] // Example #1 SplFileObject::setMaxLineLen() example // [php] // $file = new SplFileObject("lipsum.txt"); // $file->setMaxLineLen(20); // foreach ($file as $line) { // echo $line . "\n"; // } // [/php] // Contents of lipsum.txt // [result] // Lorem ipsum dolor sit amet, consectetur adipiscing elit. // Duis nec sapien felis, ac sodales nisl. // Nulla vitae magna vitae purus aliquet consequat. // [/result] // The above example will output something similar to: // [result] // Lorem ipsum dolor s // it amet, consectetu // r adipiscing elit. // // Duis nec sapien fel // is, ac sodales nisl // . // // Nulla vitae magna v // itae purus aliquet // consequat. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.setmaxlinelen.php // ========== SPLFILEOBJECT_SETMAXLINELEN - END // SYNTAX: // void SplFileObject::setMaxLineLen(int $maxLength) // Return: void } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_SETMAXLINELEN // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_TOSTRING // ============================== PUBLIC // ============================== ABOUT // Returns the current line as a string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::__toString() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_tostring($splfileobject) { $return_splfileobject_tostring = null; // ========== SPLFILEOBJECT_TOSTRING - BEGIN // ===== ABOUT // Returns the current line as a string // ===== DESCRIPTION // This method will return the current line as a string. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::__toString(): string // ===== CODE $return_splfileobject_tostring = $splfileobject->__toString( // This function has no parameters. ); // Return Values // Returns the current line as a string. // // Changelog // Version - Description // 8.1.14, 8.2.1 - Changed from an alias of SplFileObject::fgets() to an implementation of SplFileObject::current() which returns a CSV string when the SplFileObject::READ_CSV flag is set. // 7.2.19, 7.3.6 - Changed from an alias of SplFileObject::current() to an alias of SplFileObject::fgets(). // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.tostring.php // ========== SPLFILEOBJECT_TOSTRING - END // SYNTAX: // string SplFileObject::__toString() return $return_splfileobject_tostring; // string } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_TOSTRING // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_VALID // ============================== PUBLIC // ============================== ABOUT // Not at EOF. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplFileObject::valid() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_splfileobject_valid($splfileobject) { $return_splfileobject_valid = false; // ========== SPLFILEOBJECT_VALID - BEGIN // ===== ABOUT // Not at EOF // ===== DESCRIPTION // Check whether EOF has been reached. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public SplFileObject::valid(): bool // ===== CODE $return_splfileobject_valid = $splfileobject->valid( // This function has no parameters. ); // Return Values // Returns true if not reached EOF, false otherwise. // // [examples] // Examples // [example] // Example #1 SplFileObject::valid() example // [php] // // Loop over a file, line by line // $file = new SplFileObject("file.txt"); // while ($file->valid()) { // echo $file->fgets(); // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/splfileobject.valid.php // ========== SPLFILEOBJECT_VALID - END // SYNTAX: // bool SplFileObject::valid() return $return_splfileobject_valid; // bool } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT_VALID // ============================== // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLFILEOBJECT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLTEMPFILEOBJECT // ============================== PUBLIC // PHP_BASIC_SPL_FILEHANDLING_SPLTEMPFILEOBJECT_CONSTRUCT - SplTempFileObject php_basic_spl_filehandling_spltempfileobject_construct(int $maxMemory) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplTempFileObject::__construct() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== USING DATA_TYPES (2) // SplTempFileObject - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // int // ============================== // ============================== BEGIN // PHP_BASIC_SPL_FILEHANDLING_SPLTEMPFILEOBJECT_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a new temporary file object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // SplTempFileObject::__construct() - PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_filehandling_spltempfileobject_construct($maxMemory) { $return_spltempfileobject_construct = null; // ========== SPLTEMPFILEOBJECT_CONSTRUCT - BEGIN // ===== ABOUT // Construct a new temporary file object // ===== DESCRIPTION // Construct a new temporary file object. // ===== SUPPORTED // PHP_5 >= PHP_5_1_2, PHP_7, PHP_8 // ===== SYNTAX // public SplTempFileObject::__construct(int $maxMemory = 2 * 1024 * 1024) // ===== CODE $return_spltempfileobject_construct = new SplTempFileObject( $maxMemory // int maxMemory - The maximum amount of memory (in bytes, default is 2 MB) for the temporary file to use. If the temporary file exceeds this size, it will be moved to a file in the system's temp directory. // If maxMemory is negative, only memory will be used. If maxMemory is zero, no memory will be used. ); // Return // SplTempFileObject // // Errors/Exceptions // Throws a RuntimeException if an error occurs. // // [examples] // Examples // [example] // Example #1 SplTempFileObject() example // This example writes a temporary file in memory which can be written to and read from. // [php] // $temp = new SplTempFileObject(); // $temp->fwrite("This is the first line\n"); // $temp->fwrite("And this is the second.\n"); // echo "Written " . $temp->ftell() . " bytes to temporary file.\n\n"; // // // Rewind and read what was written // $temp->rewind(); // foreach ($temp as $line) { // echo $line; // } // [/php] // The above example will output something similar to: // [result] // Written 47 bytes to temporary file. // // This is the first line // And this is the second. // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/spltempfileobject.construct.php // ========== SPLTEMPFILEOBJECT_CONSTRUCT - END // SYNTAX: // SplTempFileObject SplTempFileObject::__construct(int $maxMemory = 2 * 1024 * 1024) return $return_spltempfileobject_construct; // SplTempFileObject } // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLTEMPFILEOBJECT_CONSTRUCT // ============================== // ============================== END // PHP_BASIC_SPL_FILEHANDLING_SPLTEMPFILEOBJECT // ============================== // ============================== END // PHP_BASIC_SPL_FILEHANDLING // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS // ============================== PUBLIC // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT // ============================== PUBLIC // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_APPEND - void php_basic_spl_miscellaneous_arrayobject_append(ArrayObject $arrayobject, mixed $value) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_ASORT - bool php_basic_spl_miscellaneous_arrayobject_asort(ArrayObject $arrayobject, int $flags = SORT_REGULAR) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_CONSTRUCT - ArrayObject php_basic_spl_miscellaneous_arrayobject_construct(array|object $array = array(), int $flags = 0, string $iteratorClass) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_COUNT - int php_basic_spl_miscellaneous_arrayobject_count(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_EXCHANGEARRAY - array php_basic_spl_miscellaneous_arrayobject_exchangearray(ArrayObject $arrayobject, array|object $array) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETARRAYCOPY - array php_basic_spl_miscellaneous_arrayobject_getarraycopy(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETFLAGS - int php_basic_spl_miscellaneous_arrayobject_getflags(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETITERATOR - Iterator php_basic_spl_miscellaneous_arrayobject_getiterator(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETITERATORCLASS - string php_basic_spl_miscellaneous_arrayobject_getiteratorclass(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_KSORT - bool php_basic_spl_miscellaneous_arrayobject_ksort(ArrayObject $arrayobject, int $flags = SORT_REGULAR) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_NATCASESORT - bool php_basic_spl_miscellaneous_arrayobject_natcasesort(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_NATSORT - bool php_basic_spl_miscellaneous_arrayobject_natsort(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETEXISTS - bool php_basic_spl_miscellaneous_arrayobject_offsetexists(ArrayObject $arrayobject, mixed $key) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETGET - mixed php_basic_spl_miscellaneous_arrayobject_offsetget(ArrayObject $arrayobject, mixed $key) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETSET - void php_basic_spl_miscellaneous_arrayobject_offsetset(ArrayObject $arrayobject, mixed $key, mixed $value) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETUNSET - void php_basic_spl_miscellaneous_arrayobject_offsetunset(ArrayObject $arrayobject, mixed $key) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SERIALIZE - string php_basic_spl_miscellaneous_arrayobject_serialize(ArrayObject $arrayobject) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SETFLAGS - void php_basic_spl_miscellaneous_arrayobject_setflags(ArrayObject $arrayobject, int $flags) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SETITERATORCLASS - void php_basic_spl_miscellaneous_arrayobject_setiteratorclass(ArrayObject $arrayobject, string $iteratorClass) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UASORT - bool php_basic_spl_miscellaneous_arrayobject_uasort(ArrayObject $arrayobject, callable $callback) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UKSORT - bool php_basic_spl_miscellaneous_arrayobject_uksort(ArrayObject $arrayobject, callable $callback) // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UNSERIALIZE - void php_basic_spl_miscellaneous_arrayobject_unserialize(ArrayObject $arrayobject, string $data) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (22) // ArrayObject::append() - PHP_5, PHP_7, PHP_8 // ArrayObject::asort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayObject::__construct() - PHP_5, PHP_7, PHP_8 // ArrayObject::count() - PHP_5, PHP_7, PHP_8 // ArrayObject::exchangeArray() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayObject::getArrayCopy() - PHP_5, PHP_7, PHP_8 // ArrayObject::getFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayObject::getIterator() - PHP_5, PHP_7, PHP_8 // ArrayObject::getIteratorClass() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayObject::ksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayObject::natcasesort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayObject::natsort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayObject::offsetExists() - PHP_5, PHP_7, PHP_8 // ArrayObject::offsetGet() - PHP_5, PHP_7, PHP_8 // ArrayObject::offsetSet() - PHP_5, PHP_7, PHP_8 // ArrayObject::offsetUnset() - PHP_5, PHP_7, PHP_8 // ArrayObject::serialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ArrayObject::setFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayObject::setIteratorClass() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ArrayObject::uasort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayObject::uksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ArrayObject::unserialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (10) // void // ArrayObject - PHP_5, PHP_7, PHP_8 // mixed // bool // int // array // object // string // Iterator - PHP_5, PHP_7, PHP_8 // callable // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_APPEND // ============================== PUBLIC // ============================== ABOUT // Appends the value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::append() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_append($arrayobject, $value) { // ========== ARRAYOBJECT_APPEND - BEGIN // ===== ABOUT // Appends the value // ===== DESCRIPTION // Appends a new value as the last element. // Note: This method cannot be called when the ArrayObject was constructed from an object. Use ArrayObject::offsetSet() instead. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::append(mixed $value): void // ===== CODE $arrayobject->append( $value // mixed value - The value being appended. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayObject::append() example // [php] // $arrayobj = new ArrayObject(array('first','second','third')); // $arrayobj->append('fourth'); // $arrayobj->append(array('five', 'six')); // var_dump($arrayobj); // [/php] // The above example will output: // [result] // object(ArrayObject)#1 (5) { // [0]=> // string(5) "first" // [1]=> // string(6) "second" // [2]=> // string(5) "third" // [3]=> // string(6) "fourth" // [4]=> // array(2) { // [0]=> // string(4) "five" // [1]=> // string(3) "six" // } // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-11-30) // URL: https://www.php.net/manual/en/arrayobject.append.php // ========== ARRAYOBJECT_APPEND - END // SYNTAX: // void ArrayObject::append(mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_APPEND // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_ASORT // ============================== PUBLIC // ============================== ABOUT // Sort the entries by value. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::asort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // SORT_REGULAR - ArrayObject::asort() // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_asort($arrayobject, $flags = SORT_REGULAR) { $return_arrayobject_asort = false; // ========== ARRAYOBJECT_ASORT - BEGIN // ===== ABOUT // Sort the entries by value // ===== DESCRIPTION // Sorts the entries in ascending order, such that its keys maintain their correlation with the values they are associated with. // This is used mainly when sorting associative arrays where the actual element order is significant. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::asort(int $flags = SORT_REGULAR): true // ===== CODE $return_arrayobject_asort = $arrayobject->asort( $flags // int flags - The optional second parameter flags may be used to modify the sorting behavior using these values: // // Sorting type flags: // * SORT_REGULAR - compare items normally; the details are described in the comparison operators section // * SORT_NUMERIC - compare items numerically // * SORT_STRING - compare items as strings // * SORT_LOCALE_STRING - compare items as strings, based on the current locale. It uses the locale, which can be changed using setlocale() // * SORT_NATURAL - compare items as strings using "natural ordering" like natsort() // * SORT_FLAG_CASE - can be combined (bitwise OR) with SORT_STRING or SORT_NATURAL to sort strings case-insensitively ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // // [examples] // Examples // [example] // Example #1 ArrayObject::asort() example // [php] // $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); // $fruitArrayObject = new ArrayObject($fruits); // $fruitArrayObject->asort(); // // foreach ($fruitArrayObject as $key => $val) { // echo "$key = $val\n"; // } // [/php] // The above example will output: // [result] // c = apple // b = banana // d = lemon // a = orange // [/result] // The fruits have been sorted in alphabetical order, and the key associated with each entry has been maintained. // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.asort.php // ========== ARRAYOBJECT_ASORT - END // SYNTAX: // bool ArrayObject::asort(int $flags = SORT_REGULAR) return $return_arrayobject_asort; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_ASORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_CONSTRUCT // ============================== PUBLIC // ============================== ABOUT // Construct a new array object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::__construct() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_construct($array = array(), $flags = 0, $iteratorClass) { $return_arrayobject_construct = null; // ========== ARRAYOBJECT_CONSTRUCT - BEGIN // ===== ABOUT // Construct a new array object // ===== DESCRIPTION // This constructs a new array object. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::__construct(array|object $array = [], int $flags = 0, string $iteratorClass = ArrayIterator::class) // ===== CODE $return_arrayobject_construct = new ArrayObject( $array, // array|object array - The array parameter accepts an array or an Object. $flags, // int flags - Flags to control the behaviour of the ArrayObject object. See ArrayObject::setFlags(). $iteratorClass // string iteratorClass - Specify the class that will be used for iteration of the ArrayObject object. The class must implement ArrayIterator. ); // Return // ArrayObject // // [examples] // Examples // [example] // Example #1 ArrayObject::__construct() example // [php] // $array = array('1' => 'one', // '2' => 'two', // '3' => 'three'); // // $arrayobject = new ArrayObject($array); // // var_dump($arrayobject); // [/php] // The above example will output: // [result] // object(ArrayObject)#1 (3) { // [1]=> // string(3) "one" // [2]=> // string(3) "two" // [3]=> // string(5) "three" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.construct.php // ========== ARRAYOBJECT_CONSTRUCT - END // SYNTAX: // ArrayObject ArrayObject::__construct(array|object $array = array(), int $flags = 0, string $iteratorClass) return $return_arrayobject_construct; // ArrayObject } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_CONSTRUCT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_COUNT // ============================== PUBLIC // ============================== ABOUT // Get the number of public properties in the ArrayObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::count() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_count($arrayobject) { $return_arrayobject_count = 0; // ========== ARRAYOBJECT_COUNT - BEGIN // ===== ABOUT // Get the number of public properties in the ArrayObject // ===== DESCRIPTION // Get the number of public properties in the ArrayObject. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::count(): int // ===== CODE $return_arrayobject_count = $arrayobject->count( // This function has no parameters. ); // Return Values // The number of public properties in the ArrayObject. // Note: When the ArrayObject is constructed from an array all properties are public. // // [examples] // Examples // [example] // Example #1 ArrayObject::count() example // [php] // class Example { // public $public = 'prop:public'; // private $prv = 'prop:private'; // protected $prt = 'prop:protected'; // } // // $arrayobj = new ArrayObject(new Example()); // var_dump($arrayobj->count()); // // $arrayobj = new ArrayObject(array('first','second','third')); // var_dump($arrayobj->count()); // [/php] // The above example will output: // [result] // int(1) // int(3) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.count.php // ========== ARRAYOBJECT_COUNT - END // SYNTAX: // int ArrayObject::count() return $return_arrayobject_count; // int } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_COUNT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_EXCHANGEARRAY // ============================== PUBLIC // ============================== ABOUT // Exchange the array for another one. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::exchangeArray() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_exchangearray($arrayobject, $array) { $return_arrayobject_exchangearray = null; // ========== ARRAYOBJECT_EXCHANGEARRAY - BEGIN // ===== ABOUT // Exchange the array for another one // ===== DESCRIPTION // Exchange the current array with another array or object. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::exchangeArray(array|object $array): array // ===== CODE $return_arrayobject_exchangearray = $arrayobject->exchangeArray( $array // array|object array - The new array or object to exchange with the current array. ); // Return Values // Returns the old array. // // [examples] // Examples // [example] // Example #1 ArrayObject::exchangeArray() example // [php] // // Array of available fruits // $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10); // // Array of locations in Europe // $locations = array('Amsterdam', 'Paris', 'London'); // // $fruitsArrayObject = new ArrayObject($fruits); // // // Now exchange fruits for locations // $old = $fruitsArrayObject->exchangeArray($locations); // print_r($old); // print_r($fruitsArrayObject); // // [/php] // The above example will output: // [result] // Array // ( // [lemons] => 1 // [oranges] => 4 // [bananas] => 5 // [apples] => 10 // ) // ArrayObject Object // ( // [0] => Amsterdam // [1] => Paris // [2] => London // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.exchangearray.php // ========== ARRAYOBJECT_EXCHANGEARRAY - END // SYNTAX: // array ArrayObject::exchangeArray(array|object $array) return $return_arrayobject_exchangearray; // array } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_EXCHANGEARRAY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETARRAYCOPY // ============================== PUBLIC // ============================== ABOUT // Creates a copy of the ArrayObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::getArrayCopy() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_getarraycopy($arrayobject) { $return_arrayobject_getarraycopy = null; // ========== ARRAYOBJECT_GETARRAYCOPY - BEGIN // ===== ABOUT // Creates a copy of the ArrayObject // ===== DESCRIPTION // Exports the ArrayObject to an array. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::getArrayCopy(): array // ===== CODE $return_arrayobject_getarraycopy = $arrayobject->getArrayCopy( // This function has no parameters. ); // Return Values // Returns a copy of the array. When the ArrayObject refers to an object, an array of the properties of that object will be returned. // // [examples] // Examples // [example] // Example #1 ArrayObject::getArrayCopy() example // [php] // // Array of available fruits // $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10); // // $fruitsArrayObject = new ArrayObject($fruits); // $fruitsArrayObject['pears'] = 4; // // // create a copy of the array // $copy = $fruitsArrayObject->getArrayCopy(); // print_r($copy); // // [/php] // The above example will output: // [result] // Array // ( // [lemons] => 1 // [oranges] => 4 // [bananas] => 5 // [apples] => 10 // [pears] => 4 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.getarraycopy.php // ========== ARRAYOBJECT_GETARRAYCOPY - END // SYNTAX: // array ArrayObject::getArrayCopy() return $return_arrayobject_getarraycopy; // array } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETARRAYCOPY // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETFLAGS // ============================== PUBLIC // ============================== ABOUT // Gets the behavior flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::getFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_getflags($arrayobject) { $return_arrayobject_getflags = 0; // ========== ARRAYOBJECT_GETFLAGS - BEGIN // ===== ABOUT // Gets the behavior flags // ===== DESCRIPTION // Gets the behavior flags of the ArrayObject. See the ArrayObject::setFlags method for a list of the available flags. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::getFlags(): int // ===== CODE $return_arrayobject_getflags = $arrayobject->getFlags( // This function has no parameters. ); // Return Values // Returns the behavior flags of the ArrayObject. // // [examples] // Examples // [example] // Example #1 ArrayObject::getFlags() example // [php] // // Array of available fruits // $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10); // // $fruitsArrayObject = new ArrayObject($fruits); // // // Get the current flags // $flags = $fruitsArrayObject->getFlags(); // var_dump($flags); // // // Set new flags // $fruitsArrayObject->setFlags(ArrayObject::ARRAY_AS_PROPS); // // // Get the new flags // $flags = $fruitsArrayObject->getFlags(); // var_dump($flags); // [/php] // The above example will output: // [result] // int(0) // int(2) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.getflags.php // ========== ARRAYOBJECT_GETFLAGS - END // SYNTAX: // int ArrayObject::getFlags() return $return_arrayobject_getflags; // int } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETITERATOR // ============================== PUBLIC // ============================== ABOUT // Create a new iterator from an ArrayObject instance. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::getIterator() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_getiterator($arrayobject) { $return_arrayobject_getiterator = null; // ========== ARRAYOBJECT_GETITERATOR - BEGIN // ===== ABOUT // Create a new iterator from an ArrayObject instance // ===== DESCRIPTION // Create a new iterator from an ArrayObject instance. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::getIterator(): Iterator // ===== CODE $return_arrayobject_getiterator = $arrayobject->getIterator( // This function has no parameters. ); // Return Values // An iterator from an ArrayObject. // // [examples] // Examples // [example] // Example #1 ArrayObject::getIterator() example // [php] // $array = array('1' => 'one', // '2' => 'two', // '3' => 'three'); // // $arrayobject = new ArrayObject($array); // // $iterator = $arrayobject->getIterator(); // // while($iterator->valid()) { // echo $iterator->key() . ' => ' . $iterator->current() . "\n"; // // $iterator->next(); // } // [/php] // The above example will output: // [result] // 1 => one // 2 => two // 3 => three // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.getiterator.php // ========== ARRAYOBJECT_GETITERATOR - END // SYNTAX: // Iterator ArrayObject::getIterator() return $return_arrayobject_getiterator; // Iterator } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETITERATOR // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETITERATORCLASS // ============================== PUBLIC // ============================== ABOUT // Gets the iterator classname for the ArrayObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::getIteratorClass() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_getiteratorclass($arrayobject) { $return_arrayobject_getiteratorclass = null; // ========== ARRAYOBJECT_GETITERATORCLASS - BEGIN // ===== ABOUT // Gets the iterator classname for the ArrayObject // ===== DESCRIPTION // Gets the class name of the array iterator that is used by ArrayObject::getIterator(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::getIteratorClass(): string // ===== CODE $return_arrayobject_getiteratorclass = $arrayobject->getIteratorClass( // This function has no parameters. ); // Return Values // Returns the iterator class name that is used to iterate over this object. // // [examples] // Examples // [example] // Example #1 ArrayObject::getIteratorClass() example // [php] // // Custom ArrayIterator (inherits from ArrayIterator) // class MyArrayIterator extends ArrayIterator { // // custom implementation // } // // // Array of available fruits // $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10); // // $fruitsArrayObject = new ArrayObject($fruits); // // // Get the current class name // $className = $fruitsArrayObject->getIteratorClass(); // var_dump($className); // // // Set new classname // $fruitsArrayObject->setIteratorClass('MyArrayIterator'); // // // Get the new iterator classname // $className = $fruitsArrayObject->getIteratorClass(); // var_dump($className); // [/php] // The above example will output: // [result] // string(13) "ArrayIterator" // string(15) "MyArrayIterator" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.getiteratorclass.php // ========== ARRAYOBJECT_GETITERATORCLASS - END // SYNTAX: // string ArrayObject::getIteratorClass() return $return_arrayobject_getiteratorclass; // string } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_GETITERATORCLASS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_KSORT // ============================== PUBLIC // ============================== ABOUT // Sort the entries by key. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::ksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== USING CONSTANTS (1) // SORT_REGULAR - ArrayObject::ksort() // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_ksort($arrayobject, $flags = SORT_REGULAR) { $return_arrayobject_ksort = false; // ========== ARRAYOBJECT_KSORT - BEGIN // ===== ABOUT // Sort the entries by key // ===== DESCRIPTION // Sorts the entries by key, maintaining key to entry correlations. This is useful mainly for associative arrays. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::ksort(int $flags = SORT_REGULAR): true // ===== CODE $return_arrayobject_ksort = $arrayobject->ksort( $flags // int flags - The optional second parameter flags may be used to modify the sorting behavior using these values: // Sorting type flags: // * SORT_REGULAR - compare items normally; the details are described in the comparison operators section // * SORT_NUMERIC - compare items numerically // * SORT_STRING - compare items as strings // * SORT_LOCALE_STRING - compare items as strings, based on the current locale. It uses the locale, which can be changed using setlocale() // * SORT_NATURAL - compare items as strings using "natural ordering" like natsort() // * SORT_FLAG_CASE - can be combined (bitwise OR) with SORT_STRING or SORT_NATURAL to sort strings case-insensitively ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // // [examples] // Examples // [example] // Example #1 ArrayObject::ksort() example // [php] // $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); // $fruitArrayObject = new ArrayObject($fruits); // $fruitArrayObject->ksort(); // // foreach ($fruitArrayObject as $key => $val) { // echo "$key = $val\n"; // } // [/php] // The above example will output: // [result] // a = orange // b = banana // c = apple // d = lemon // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.ksort.php // ========== ARRAYOBJECT_KSORT - END // SYNTAX: // bool ArrayObject::ksort(int $flags = SORT_REGULAR) return $return_arrayobject_ksort; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_KSORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_NATCASESORT // ============================== PUBLIC // ============================== ABOUT // Sort an array using a case insensitive "natural order" algorithm. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::natcasesort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_natcasesort($arrayobject) { $return_arrayobject_natcasesort = false; // ========== ARRAYOBJECT_NATCASESORT - BEGIN // ===== ABOUT // Sort an array using a case insensitive "natural order" algorithm // ===== DESCRIPTION // This method is a case insensitive version of ArrayObject::natsort. // This method implements a sort algorithm that orders alphanumeric strings in the way a human being would while maintaining key/value associations. This is described as a "natural ordering". // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::natcasesort(): true // ===== CODE $return_arrayobject_natcasesort = $arrayobject->natcasesort( // This function has no parameters. ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // // [examples] // Examples // [example] // Example #1 ArrayObject::natcasesort() example // [php] // $array = array('IMG0.png', 'img12.png', 'img10.png', 'img2.png', 'img1.png', 'IMG3.png'); // // $arr1 = new ArrayObject($array); // $arr2 = clone $arr1; // // $arr1->asort(); // echo "Standard sorting\n"; // print_r($arr1); // // $arr2->natcasesort(); // echo "\nNatural order sorting (case-insensitive)\n"; // print_r($arr2); // [/php] // The above example will output: // [result] // Standard sorting // ArrayObject Object // ( // [0] => IMG0.png // [5] => IMG3.png // [4] => img1.png // [2] => img10.png // [1] => img12.png // [3] => img2.png // ) // // Natural order sorting (case-insensitive) // ArrayObject Object // ( // [0] => IMG0.png // [4] => img1.png // [3] => img2.png // [5] => IMG3.png // [2] => img10.png // [1] => img12.png // ) // [/result] // For more information see: Martin Pool's > Natural Order String Comparison page. // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.natcasesort.php // ========== ARRAYOBJECT_NATCASESORT - END // SYNTAX: // bool ArrayObject::natcasesort() return $return_arrayobject_natcasesort; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_NATCASESORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_NATSORT // ============================== PUBLIC // ============================== ABOUT // Sort entries using a "natural order" algorithm. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::natsort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_natsort($arrayobject) { $return_arrayobject_natsort = false; // ========== ARRAYOBJECT_NATSORT - BEGIN // ===== ABOUT // Sort entries using a "natural order" algorithm // ===== DESCRIPTION // This method implements a sort algorithm that orders alphanumeric strings in the way a human being would while maintaining key/value associations. This is described as a "natural ordering". An example of the difference between this algorithm and the regular computer string sorting algorithms (used in ArrayObject::asort) method can be seen in the example below. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::natsort(): true // ===== CODE $return_arrayobject_natsort = $arrayobject->natsort( // This function has no parameters. ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // // [examples] // Examples // [example] // Example #1 ArrayObject::natsort() example // [php] // $array = array("img12.png", "img10.png", "img2.png", "img1.png"); // // $arr1 = new ArrayObject($array); // $arr2 = clone $arr1; // // $arr1->asort(); // echo "Standard sorting\n"; // print_r($arr1); // // $arr2->natsort(); // echo "\nNatural order sorting\n"; // print_r($arr2); // [/php] // The above example will output: // [result] // Standard sorting // ArrayObject Object // ( // [3] => img1.png // [1] => img10.png // [0] => img12.png // [2] => img2.png // ) // // Natural order sorting // ArrayObject Object // ( // [3] => img1.png // [2] => img2.png // [1] => img10.png // [0] => img12.png // ) // [/result] // For more information see: Martin Pool's > Natural Order String Comparison page. // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.natsort.php // ========== ARRAYOBJECT_NATSORT - END // SYNTAX: // bool ArrayObject::natsort() return $return_arrayobject_natsort; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_NATSORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETEXISTS // ============================== PUBLIC // ============================== ABOUT // Returns whether the requested index exists. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::offsetExists() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_offsetexists($arrayobject, $key) { $return_arrayobject_offsetexists = false; // ========== ARRAYOBJECT_OFFSETEXISTS - BEGIN // ===== ABOUT // Returns whether the requested index exists // ===== DESCRIPTION // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::offsetExists(mixed $key): bool // ===== CODE $return_arrayobject_offsetexists = $arrayobject->offsetExists( $key // mixed key - The index being checked. ); // Return Values // true if the requested index exists, otherwise false // // [examples] // Examples // [example] // Example #1 ArrayObject::offsetExists() example // [php] // $arrayobj = new ArrayObject(array('zero', 'one', 'example'=>'e.g.')); // var_dump($arrayobj->offsetExists(1)); // var_dump($arrayobj->offsetExists('example')); // var_dump($arrayobj->offsetExists('notfound')); // [/php] // The above example will output: // [result] // bool(true) // bool(true) // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.offsetexists.php // ========== ARRAYOBJECT_OFFSETEXISTS - END // SYNTAX: // bool ArrayObject::offsetExists(mixed $key) return $return_arrayobject_offsetexists; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETEXISTS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETGET // ============================== PUBLIC // ============================== ABOUT // Returns the value at the specified index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::offsetGet() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_offsetget($arrayobject, $key) { $return_arrayobject_offsetget = null; // ========== ARRAYOBJECT_OFFSETGET - BEGIN // ===== ABOUT // Returns the value at the specified index // ===== DESCRIPTION // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::offsetGet(mixed $key): mixed // ===== CODE $return_arrayobject_offsetget = $arrayobject->offsetGet( $key // mixed key - The index with the value. ); // Return Values // The value at the specified index or null. // // Errors/Exceptions // Produces an E_NOTICE error message when the specified index does not exist. // // [examples] // Examples // [example] // Example #1 ArrayObject::offsetGet() example // [php] // $arrayobj = new ArrayObject(array('zero', 7, 'example'=>'e.g.')); // var_dump($arrayobj->offsetGet(1)); // var_dump($arrayobj->offsetGet('example')); // var_dump($arrayobj->offsetExists('notfound')); // [/php] // The above example will output: // [result] // int(7) // string(4) "e.g." // bool(false) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.offsetget.php // ========== ARRAYOBJECT_OFFSETGET - END // SYNTAX: // mixed ArrayObject::offsetGet(mixed $key) return $return_arrayobject_offsetget; // mixed } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETGET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETSET // ============================== PUBLIC // ============================== ABOUT // Sets the value at the specified index to newval. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::offsetSet() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_offsetset($arrayobject, $key, $value) { // ========== ARRAYOBJECT_OFFSETSET - BEGIN // ===== ABOUT // Sets the value at the specified index to newval // ===== DESCRIPTION // Sets the value at the specified index to newval. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::offsetSet(mixed $key, mixed $value): void // ===== CODE $arrayobject->offsetSet( $key, // mixed key - The index being set. $value // mixed value - The new value for the key. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayObject::offsetSet() example // [php] // class Example { // public $property = 'prop:public'; // } // $arrayobj = new ArrayObject(new Example()); // $arrayobj->offsetSet(4, 'four'); // $arrayobj->offsetSet('group', array('g1', 'g2')); // var_dump($arrayobj); // // $arrayobj = new ArrayObject(array('zero','one')); // $arrayobj->offsetSet(null, 'last'); // var_dump($arrayobj); // [/php] // The above example will output: // [result] // object(ArrayObject)#1 (3) { // ["property"]=> // string(11) "prop:public" // [4]=> // string(4) "four" // ["group"]=> // array(2) { // [0]=> // string(2) "g1" // [1]=> // string(2) "g2" // } // } // object(ArrayObject)#3 (3) { // [0]=> // string(4) "zero" // [1]=> // string(3) "one" // [2]=> // string(4) "last" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.offsetset.php // ========== ARRAYOBJECT_OFFSETSET - END // SYNTAX: // void ArrayObject::offsetSet(mixed $key, mixed $value) // Return: void } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETUNSET // ============================== PUBLIC // ============================== ABOUT // Unsets the value at the specified index. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::offsetUnset() - PHP_5, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_offsetunset($arrayobject, $key) { // ========== ARRAYOBJECT_OFFSETUNSET - BEGIN // ===== ABOUT // Unsets the value at the specified index // ===== DESCRIPTION // Unsets the value at the specified index. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::offsetUnset(mixed $key): void // ===== CODE $arrayobject->offsetUnset( $key // mixed key - The index being unset. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayObject::offsetUnset() example // [php] // $arrayobj = new ArrayObject(array(0=>'zero',2=>'two')); // $arrayobj->offsetUnset(2); // var_dump($arrayobj); // [/php] // The above example will output: // [result] // object(ArrayObject)#1 (1) { // [0]=> // string(4) "zero" // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.offsetunset.php // ========== ARRAYOBJECT_OFFSETUNSET - END // SYNTAX: // void ArrayObject::offsetUnset(mixed $key) // Return: void } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_OFFSETUNSET // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SERIALIZE // ============================== PUBLIC // ============================== ABOUT // Serialize an ArrayObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::serialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_serialize($arrayobject) { $return_arrayobject_serialize = null; // ========== ARRAYOBJECT_SERIALIZE - BEGIN // ===== ABOUT // Serialize an ArrayObject // ===== DESCRIPTION // Serializes an ArrayObject. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::serialize(): string // ===== CODE $return_arrayobject_serialize = $arrayobject->serialize( // This function has no parameters. ); // Return Values // The serialized representation of the ArrayObject. // // [examples] // Examples // [example] // Example #1 ArrayObject::serialize() example // [php] // $o = new ArrayObject(); // // $s1 = serialize($o); // $s2 = $o->serialize(); // // var_dump($s1); // var_dump($s2); // [/php] // The above example will output: // [result] // string(45) "C:11:"ArrayObject":21:{x:i:0;a:0:{};m:a:0:{}}" // string(21) "x:i:0;a:0:{};m:a:0:{}" // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.serialize.php // ========== ARRAYOBJECT_SERIALIZE - END // SYNTAX: // string ArrayObject::serialize() return $return_arrayobject_serialize; // string } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SERIALIZE // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SETFLAGS // ============================== PUBLIC // ============================== ABOUT // Sets the behavior flags. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::setFlags() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_setflags($arrayobject, $flags) { // ========== ARRAYOBJECT_SETFLAGS - BEGIN // ===== ABOUT // Sets the behavior flags // ===== DESCRIPTION // Set the flags that change the behavior of the ArrayObject. // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::setFlags(int $flags): void // ===== CODE $arrayobject->setFlags( $flags // int flags - The new ArrayObject behavior. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. // The available behavior flags are listed below. The actual meanings of these flags are described in the predefined constants. // // ArrayObject behavior flags // value - constant // 1 - ArrayObject::STD_PROP_LIST // 2 - ArrayObject::ARRAY_AS_PROPS ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayObject::setFlags() example // [php] // // Array of available fruits // $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10); // // $fruitsArrayObject = new ArrayObject($fruits); // // // Try to use array key as property // var_dump($fruitsArrayObject->lemons); // // Set the flag so that the array keys can be used as properties of the ArrayObject // $fruitsArrayObject->setFlags(ArrayObject::ARRAY_AS_PROPS); // // Try it again // var_dump($fruitsArrayObject->lemons); // [/php] // The above example will output: // [result] // NULL // int(1) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.setflags.php // ========== ARRAYOBJECT_SETFLAGS - END // SYNTAX: // void ArrayObject::setFlags(int $flags) // return: void } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SETFLAGS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SETITERATORCLASS // ============================== PUBLIC // ============================== ABOUT // Sets the iterator classname for the ArrayObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::setIteratorClass() - PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_setiteratorclass($arrayobject, $iteratorClass) { // ========== ARRAYOBJECT_SETITERATORCLASS - BEGIN // ===== ABOUT // Sets the iterator classname for the ArrayObject // ===== DESCRIPTION // Sets the classname of the array iterator that is used by ArrayObject::getIterator(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::setIteratorClass(string $iteratorClass): void // ===== CODE $arrayobject->setIteratorClass( $iteratorClass // string iteratorClass - The classname of the array iterator to use when iterating over this object. ); // Return Values // No value is returned. // // [examples] // Examples // [example] // Example #1 ArrayObject::setIteratorClass() example // [php] // // Custom ArrayIterator (inherits from ArrayIterator) // class MyArrayIterator extends ArrayIterator { // // custom implementation // } // // // Array of available fruits // $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10); // // $fruitsArrayObject = new ArrayObject($fruits); // // // Set the iterator classname to the newly // $fruitsArrayObject->setIteratorClass('MyArrayIterator'); // print_r($fruitsArrayObject->getIterator()); // // [/php] // The above example will output: // [result] // MyArrayIterator Object // ( // [lemons] => 1 // [oranges] => 4 // [bananas] => 5 // [apples] => 10 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.setiteratorclass.php // ========== ARRAYOBJECT_SETITERATORCLASS - END // SYNTAX: // void ArrayObject::setIteratorClass(string $iteratorClass) // Return: void } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_SETITERATORCLASS // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UASORT // ============================== PUBLIC // ============================== ABOUT // Sort the entries with a user-defined comparison function and maintain key association. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::uasort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_uasort($arrayobject, $callback) { $return_arrayobject_uasort = false; // ========== ARRAYOBJECT_UASORT - BEGIN // ===== ABOUT // Sort the entries with a user-defined comparison function and maintain key association // ===== DESCRIPTION // This function sorts the entries such that keys maintain their correlation with the entry that they are associated with, using a user-defined comparison function. // This is used mainly when sorting associative arrays where the actual element order is significant. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::uasort(callable $callback): true // ===== CODE $return_arrayobject_uasort = $arrayobject->uasort( $callback // callable callback - The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. // callback(mixed $a, mixed $b): int // Caution: Returning non-integer values from the comparison function, such as float, will result in an internal cast to int of the callback's return value. So values such as 0.99 and 0.1 will both be cast to an integer value of 0, which will compare such values as equal. ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // // [examples] // Examples // [example] // Example #1 ArrayObject::uasort() example // [php] // // Comparison function // function cmp($a, $b) { // if ($a == $b) { // return 0; // } // return ($a < $b) ? -1 : 1; // } // // // Array to be sorted // $array = array('a' => 4, 'b' => 8, 'c' => -1, 'd' => -9, 'e' => 2, 'f' => 5, 'g' => 3, 'h' => -4); // $arrayObject = new ArrayObject($array); // print_r($arrayObject); // // // Sort and print the resulting array // $arrayObject->uasort('cmp'); // print_r($arrayObject); // [/php] // The above example will output: // [result] // Array // ( // [a] => 4 // [b] => 8 // [c] => -1 // [d] => -9 // [e] => 2 // [f] => 5 // [g] => 3 // [h] => -4 // ) // Array // ( // [d] => -9 // [h] => -4 // [c] => -1 // [e] => 2 // [g] => 3 // [a] => 4 // [f] => 5 // [b] => 8 // ) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.uasort.php // ========== ARRAYOBJECT_UASORT - END // SYNTAX: // bool ArrayObject::uasort(callable $callback) return $return_arrayobject_uasort; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UASORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UKSORT // ============================== PUBLIC // ============================== ABOUT // Sort the entries by keys using a user-defined comparison function. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::uksort() - PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_uksort($arrayobject, $callback) { $return_arrayobject_uksort = false; // ========== ARRAYOBJECT_UKSORT - BEGIN // ===== ABOUT // Sort the entries by keys using a user-defined comparison function // ===== DESCRIPTION // This function sorts the keys of the entries using a user-supplied comparison function. The key to entry correlations will be maintained. // Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined. // ===== SUPPORTED // PHP_5 >= PHP_5_2_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::uksort(callable $callback): true // ===== CODE $return_arrayobject_uksort = $arrayobject->uksort( $callback // callable callback - The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. // callback(mixed $a, mixed $b): int // Caution: Returning non-integer values from the comparison function, such as float, will result in an internal cast to int of the callback's return value. So values such as 0.99 and 0.1 will both be cast to an integer value of 0, which will compare such values as equal. ); // Return Values // Always returns true. // // Changelog // Version - Description // 8.2.0 - The return type is true now; previously, it was bool. // // [examples] // Examples // [example] // Example #1 ArrayObject::uksort() example // [php] // function cmp($a, $b) { // $a = preg_replace('@^(a|an|the) @', '', $a); // $b = preg_replace('@^(a|an|the) @', '', $b); // return strcasecmp($a, $b); // } // // $array = array("John" => 1, "the Earth" => 2, "an apple" => 3, "a banana" => 4); // $arrayObject = new ArrayObject($array); // $arrayObject->uksort('cmp'); // // foreach ($arrayObject as $key => $value) { // echo "$key: $value\n"; // } // [/php] // The above example will output: // [result] // an apple: 3 // a banana: 4 // the Earth: 2 // John: 1 // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.uksort.php // ========== ARRAYOBJECT_UKSORT - END // SYNTAX: // bool ArrayObject::uksort(callable $callback) return $return_arrayobject_uksort; // bool } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UKSORT // ============================== // ============================== BEGIN // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UNSERIALIZE // ============================== PUBLIC // ============================== ABOUT // Unserialize an ArrayObject. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // ArrayObject::unserialize() - PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ============================== CODE function php_basic_spl_miscellaneous_arrayobject_unserialize($arrayobject, $data) { // ========== ARRAYOBJECT_UNSERIALIZE - BEGIN // ===== ABOUT // Unserialize an ArrayObject // ===== DESCRIPTION // Unserializes a serialized ArrayObject. // Warning: This function is currently not documented; only its argument list is available. // ===== SUPPORTED // PHP_5 >= PHP_5_3_0, PHP_7, PHP_8 // ===== SYNTAX // public ArrayObject::unserialize(string $data): void // ===== CODE $arrayobject->unserialize( $data // string data - The serialized ArrayObject. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2023-12-13) // URL: https://www.php.net/manual/en/arrayobject.unserialize.php // ========== ARRAYOBJECT_UNSERIALIZE - END // SYNTAX: // void ArrayObject::unserialize(string $data) // Return: void } // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT_UNSERIALIZE // ============================== // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS_ARRAYOBJECT // ============================== // ============================== END // PHP_BASIC_SPL_MISCELLANEOUS // ============================== // ============================== END // PHP_BASIC_SPL // ============================== ?>