SplQueue::count — Get the queue size
Use `SplQueue::count` to read the current number of elements in a FIFO queue without removing anything. An empty queue returns `0`.
CKTIS / PHP
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Use `SplQueue::count` to read the current number of elements in a FIFO queue without removing anything. An empty queue returns `0`.
`dequeue()` removes the front item from a FIFO queue and returns its value. An empty queue throws `RuntimeException`, while `null` can be a legitimate stored value.
Add one value to the back of a `SplQueue`. The method changes the queue in place and returns no result; items are taken out in FIFO order.
`isEmpty()` checks whether a `SplQueue` contains zero elements. Use it before `dequeue()` to distinguish an empty queue from one that holds `null` or `false`.
`isEmpty()` checks whether an `SplStack` holds zero elements. A stack containing a single `false` value is still non-empty.
Remove the top item from a stack and return its value. Calling this method on an empty stack throws a `\RuntimeException`.
Use push() to add one value to an existing SplStack. The next pop() removes and returns that value if the top of the stack has not changed in the meantime.
`SplStack::top` returns the value at the top of a stack without removing the element. On an empty stack it throws `\RuntimeException`.
Normalize associative column names before looking them up.
Split successive elements into groups of a positive size for batch processing.
Extract one field from each record and optionally index the resulting values by another field.
Use one list for the keys and another for the values of a new array.
Build a frequency table from integer or string values.
Keep entries of the first array whose values are absent from every comparison array.
Find first-array entries for which no other array contains the same key and matching value.
Remove entries of the first array whose keys occur in any comparison array.
Initialize consecutive integer keys from a chosen starting index, assigning the same value at each key.
Turn the values of a list into keys and initialize every resulting entry with one common value.
array_filter keeps elements that satisfy a callback condition. Without a callback it removes values PHP considers empty, including the number 0 and the string "0".
Exchange keys and values to build a reverse lookup.
Keep first-array values that occur in every other array.
Retain an entry from the first array only when every comparison array has the same key together with a matching value.
Select first-array entries by keys present in every other array.
Test whether the keys, in iteration order, are consecutive integers starting at zero.