public class ArrayModule extends AbstractQuercusModule
Modifier and Type | Field and Description |
---|---|
static boolean |
CASE_INSENSITIVE |
static int |
CASE_LOWER |
static boolean |
CASE_SENSITIVE |
static int |
CASE_UPPER |
static int |
COUNT_NORMAL |
static int |
COUNT_RECURSIVE |
static int |
EXTR_IF_EXISTS |
static int |
EXTR_OVERWRITE |
static int |
EXTR_PREFIX_ALL |
static int |
EXTR_PREFIX_IF_EXISTS |
static int |
EXTR_PREFIX_INVALID |
static int |
EXTR_PREFIX_SAME |
static int |
EXTR_REFS |
static int |
EXTR_SKIP |
static boolean |
KEY_RESET |
static boolean |
NO_KEY_RESET |
static boolean |
NOT_STRICT |
static int |
SORT_ASC |
static int |
SORT_DESC |
static int |
SORT_LOCALE_STRING |
static int |
SORT_NORMAL |
static int |
SORT_NUMERIC |
static int |
SORT_REGULAR |
static int |
SORT_REVERSE |
static int |
SORT_STRING |
static boolean |
STRICT |
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
Constructor and Description |
---|
ArrayModule() |
Modifier and Type | Method and Description |
---|---|
static Value |
array_change_key_case(Env env,
ArrayValue array,
int toCase)
Changes the key case
|
static Value |
array_chunk(Env env,
ArrayValue array,
int size,
boolean preserveKeys)
Chunks the array
|
static Value |
array_combine(Env env,
ArrayValue keys,
ArrayValue values)
Combines array
|
Value |
array_copy_recursive(Value value) |
static Value |
array_count_values(Env env,
ArrayValue array)
Counts the values
|
static Value |
array_diff_assoc(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and not in the other
arrays, keys also used
|
static Value |
array_diff_key(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and not in the other
arrays, keys used for comparison
|
static Value |
array_diff_uassoc(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and not in the other
arrays, keys used for comparison aswell
|
static Value |
array_diff_ukey(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and not in the other
arrays, keys used for comparison only
|
static Value |
array_diff(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and not in the other
arrays using a passed callback function for comparing
|
static ArrayValue |
array_fill_keys(Env env,
ArrayValue keyArray,
Value value) |
static Value |
array_fill(Env env,
long start,
long num,
Value value)
Returns an array with a number of indices filled with the given value,
starting at the start index.
|
static Value |
array_filter(Env env,
ArrayValue array,
Value callbackName)
Returns an array that filters out any values that do not hold true when
used in the callback function.
|
static Value |
array_flip(Env env,
ArrayValue array)
Returns an array with the given array's keys as values and its values as
keys.
|
static Value |
array_intersect_assoc(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and also in the other
arrays, keys are also used in the comparison
|
static Value |
array_intersect_key(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and also in the other
arrays, keys are only used in the comparison
|
static Value |
array_intersect_uassoc(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and also in the other
arrays, keys are also used in the comparison.
|
static Value |
array_intersect_ukey(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and also in the other
arrays, keys are only used in the comparison.
|
static Value |
array_intersect(Env env,
ArrayValue array,
Value[] arrays)
Returns an array with everything that is in array and also in the other
arrays
|
static boolean |
array_key_exists(Env env,
Value key,
Value searchArray)
Checks if the key is in the given array
|
static Value |
array_keys(Env env,
ArrayValue array,
Value searchValue,
boolean isStrict)
Returns an array of the keys in the given array
|
static Value |
array_map(Env env,
Callable fun,
ArrayValue arg,
Value[] args)
Maps the given function with the array arguments.
|
static Value |
array_merge_recursive(Env env,
Value[] args)
Maps the given function with the array arguments.
|
static Value |
array_merge(Env env,
Value[] args)
Maps the given function with the array arguments.
|
static boolean |
array_multisort(Env env,
Value[] arrays)
Sort the arrays like rows in a database.
|
static Value |
array_pad(Env env,
ArrayValue input,
long padSize,
Value padValue)
Returns an array with either the front/end padded with the pad value.
|
static Value |
array_pop(Env env,
Value array)
Pops off the top element
|
static Value |
array_product(Env env,
ArrayValue array)
Returns the product of the input array's elements as a double.
|
static int |
array_push(Env env,
Value array,
Value[] values)
Appends a value to the array
|
static Value |
array_rand(Env env,
ArrayValue array,
long num)
Returns num sized array of random keys from the given array
|
static Value |
array_reduce(Env env,
ArrayValue array,
Callable callable,
Value initialValue)
Returns the value of the array when its elements have been reduced using
the callback function.
|
static Value |
array_replace_recursive(Env env,
Value[] args)
Replace elements in the first array with values from successive ones
|
static Value |
array_replace(Env env,
Value[] args)
Replace elements in the first array with values from successive ones
|
static Value |
array_reverse(Env env,
ArrayValue inputArray,
boolean keyed)
Returns the inputted array reversed, preserving the keys if keyed is true
|
static Value |
array_search(Env env,
Value needle,
ArrayValue array,
boolean strict)
Returns the key of the needle being searched for or false if it's not
found
|
static Value |
array_shift(Env env,
Value value)
Shifts the elements in the array left by one, returning the leftmost value
|
static Value |
array_slice(Env env,
ArrayValue array,
int offset,
Value length,
boolean isPreserveKeys)
Returns a chunk of the array.
|
static Value |
array_splice(Env env,
Value arrayVar,
int offset,
Value length,
Value replace)
Returns the removed chunk of the arrayV and splices in replace.
|
static Value |
array_sum(Env env,
ArrayValue array)
Returns the sum of the elements in the array
|
static Value |
array_udiff_assoc(Env env,
Value[] arrays)
Creates an array with all the values of the first array that are not
present in the other arrays, using a provided callback function to
determine equivalence.
|
static Value |
array_udiff_uassoc(Env env,
Value[] arrays)
Creates an array with all the values of the first array that are not
present in the other arrays, using a provided callback function to
determine equivalence.
|
static Value |
array_udiff(Env env,
Value[] arrays)
Creates an array with all the values of the first array that are not
present in the other arrays, using a provided callback function to
determine equivalence.
|
static Value |
array_uintersect_assoc(Env env,
Value[] arrays)
Creates an array with all the values of the first array that are present in
the other arrays, using a provided callback function to determine
equivalence.
|
static Value |
array_uintersect_uassoc(Env env,
Value[] arrays)
Creates an array with all the values of the first array that are present in
the other arrays, using a provided callback function to determine
equivalence.
|
static Value |
array_uintersect(Env env,
Value[] arrays)
Creates an array with all the values of the first array that are present in
the other arrays, using a provided callback function to determine
equivalence.
|
static Value |
array_unique(Env env,
ArrayValue array)
Returns the inputted array without duplicates
|
static Value |
array_unshift(Env env,
Value value,
Value[] values)
Prepends the elements to the array
|
static Value |
array_values(Env env,
ArrayValue array)
Returns the values in the passed array with numerical indices.
|
static boolean |
array_walk_recursive(Env env,
Value arrayVar,
Callable callback,
Value extra)
Recursively executes a callback function on all elements in the array,
including elements of elements (i.e., arrays within arrays).
|
static boolean |
array_walk(Env env,
Value arrayVar,
Callable callback,
Value userData)
Executes a callback on each of the elements in the array.
|
static boolean |
arsort(Env env,
Value arrayVar,
long sortFlag)
Sorts the array based on values in reverse order, preserving keys
|
static boolean |
asort(Env env,
Value arrayVar,
long sortFlag)
Sorts the array based on values in ascending order, preserving keys
|
static ArrayValue |
compact(Env env,
Value[] variables)
Creates an array of corresponding values to variables in the symbol name.
|
static long |
count(Env env,
Value value,
int countMethod)
Returns the size of the array.
|
static Value |
current(Value value)
Returns the current value of the array.
|
static Value |
each(Env env,
Value value)
Returns the next value of the array.
|
static Value |
end(Value value)
Resets the pointer to the end
|
static Value |
extract(Env env,
ArrayValue array)
Inputs new variables into the symbol table from the passed array
|
static Value |
extract(Env env,
ArrayValue array,
long rawType,
Value valuePrefix)
Inputs new variables into the symbol table from the passed array
|
java.lang.String[] |
getLoadedExtensions()
Returns the extensions loaded by the module.
|
static boolean |
in_array(Value needle,
ArrayValue stack,
boolean strict)
Determines if the key is in the array
|
static boolean |
key_exists(Env env,
Value key,
Value searchArray)
|
static Value |
key(Value value)
Returns the current key of the array.
|
static boolean |
krsort(Env env,
Value arrayVar,
long sortFlag)
Sorts the array based on keys in reverse order, preserving keys
|
static boolean |
ksort(Env env,
Value arrayVar,
long sortFlag)
Sorts the array based on keys in ascending order, preserving keys
|
static Value |
natcasesort(Env env,
Value arrayVar)
Sorts the array based on string values using natural order, preserving
keys, case insensitive
|
static Value |
natsort(Env env,
Value arrayVar)
Sorts the array based on string values using natural order, preserving
keys, case sensitive
|
static Value |
next(Value value)
Returns the next value of the array.
|
static Value |
pos(Value value)
Returns the current value of the array.
|
static Value |
prev(Value array)
Returns the previous value of the array.
|
static Value |
range(Env env,
Value startV,
Value endV,
long step)
Creates an array using the start and end values provided
|
static Value |
reset(Value array)
Resets the pointer
|
static boolean |
rsort(Env env,
Value arrayVar,
long sortFlag)
Sorts the array based on values in reverse order
|
static Value |
shuffle(Env env,
Value array)
Returns the current value of the array.
|
static long |
sizeof(Env env,
Value value,
int countMethod)
Returns the size of the array.
|
static boolean |
sort(Env env,
Value arrayVar,
long sortFlag)
Sorts the array based on values in ascending order
|
static Value |
spliceImpl(Env env,
Value var,
ArrayValue array,
int start,
int end,
ArrayValue replace) |
static boolean |
uasort(Env env,
Value arrayVar,
Callable func,
long sortFlag)
Sorts the array based on values in ascending order using a callback
function
|
static boolean |
uksort(Env env,
Value arrayVar,
Callable func,
long sortFlag)
Sorts the array based on values in ascending order using a callback
function
|
static boolean |
usort(Env env,
Value arrayVar,
Callable func,
long sortFlag)
Sorts the array based on values in ascending order using a callback
function
|
addConstant, addConstant, addConstant, getConstMap, getIniDefinitions
public static final int CASE_UPPER
public static final int CASE_LOWER
public static final int SORT_REGULAR
public static final int SORT_NUMERIC
public static final int SORT_STRING
public static final int SORT_LOCALE_STRING
public static final int SORT_NORMAL
public static final int SORT_REVERSE
public static final int SORT_DESC
public static final int SORT_ASC
public static final int EXTR_OVERWRITE
public static final int EXTR_SKIP
public static final int EXTR_PREFIX_SAME
public static final int EXTR_PREFIX_ALL
public static final int EXTR_PREFIX_INVALID
public static final int EXTR_IF_EXISTS
public static final int EXTR_PREFIX_IF_EXISTS
public static final int EXTR_REFS
public static final int COUNT_NORMAL
public static final int COUNT_RECURSIVE
public static final boolean CASE_SENSITIVE
public static final boolean CASE_INSENSITIVE
public static final boolean KEY_RESET
public static final boolean NO_KEY_RESET
public static final boolean STRICT
public static final boolean NOT_STRICT
public java.lang.String[] getLoadedExtensions()
AbstractQuercusModule
getLoadedExtensions
in interface QuercusModule
getLoadedExtensions
in class AbstractQuercusModule
public static Value array_change_key_case(Env env, ArrayValue array, int toCase)
public static Value array_chunk(Env env, ArrayValue array, int size, boolean preserveKeys)
public static Value array_combine(Env env, ArrayValue keys, ArrayValue values)
public static Value array_count_values(Env env, ArrayValue array)
public static Value array_diff_assoc(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
againstpublic static Value array_diff_key(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
againstpublic static Value array_diff_uassoc(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static Value array_diff_ukey(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static Value array_diff(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
againstpublic static ArrayValue array_fill_keys(Env env, ArrayValue keyArray, Value value)
public static Value array_fill(Env env, long start, long num, Value value)
start
- the index to start filling the arraynum
- the number of entries to fillvalue
- the value to fill the entries withpublic static Value array_filter(Env env, ArrayValue array, Value callbackName)
array
- the array to filtercallback
- the function name for filteringpublic static Value array_flip(Env env, ArrayValue array)
array
- the array to flippublic static Value array_intersect_assoc(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static Value array_intersect_key(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static Value array_intersect_uassoc(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static Value array_intersect_ukey(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static Value array_intersect(Env env, ArrayValue array, Value[] arrays)
array
- the primary arrayarrays
- the vector of arrays to check the primary array's values
against. The last element is the callback function.public static boolean array_key_exists(Env env, Value key, Value searchArray)
key
- a key to check for in the arraysearchArray
- the array to search for the key inpublic static Value array_keys(Env env, ArrayValue array, Value searchValue, boolean isStrict)
array
- the array to obtain the keys forsearchValue
- the corresponding value of the returned key arraypublic static Value array_map(Env env, Callable fun, ArrayValue arg, Value[] args)
fun
- the function nameargs
- the vector of array argumentspublic static Value array_merge_recursive(Env env, Value[] args)
args
- the vector of array argumentspublic static Value array_merge(Env env, Value[] args)
args
- the vector of array argumentspublic static boolean array_multisort(Env env, Value[] arrays)
arrays
- arrays to sortpublic static Value array_pad(Env env, ArrayValue input, long padSize, Value padValue)
input
- the array to padpadSize
- the amount to pad the array bypadValue
- determines front/back padding and the value to place in the
padded spacepublic static Value array_product(Env env, ArrayValue array)
array
- the array for who's product is to be foundpublic static int array_push(Env env, Value array, Value[] values)
public static Value array_rand(Env env, ArrayValue array, long num)
array
- the array from which the keys will come fromnum
- the number of random keys to returnpublic static Value array_reduce(Env env, ArrayValue array, Callable callable, Value initialValue)
array
- the array to reducecallback
- the function to use for reducing the arrayinitialValue
- used as the element before the first element of the
array for purposes of using the callback functionpublic static Value array_replace_recursive(Env env, Value[] args)
public static Value array_replace(Env env, Value[] args)
public static Value array_reverse(Env env, ArrayValue inputArray, boolean keyed)
inputArray
- the array to reversekeyed
- true if the keys are to be preservedpublic static Value array_search(Env env, Value needle, ArrayValue array, boolean strict)
needle
- the value to search forarray
- the array to searchstrict
- checks for type aswellpublic static Value array_shift(Env env, Value value)
array
- the array to shiftpublic static Value array_slice(Env env, ArrayValue array, int offset, Value length, boolean isPreserveKeys)
array
- the array to take the chunk fromoffset
- the start index for the new array chunkelements
- the number of elements in the array chunkpresKeys
- true if the keys of the elements are to be preserved, false
otherwisepublic static Value array_splice(Env env, Value arrayVar, int offset, Value length, Value replace)
array
- the arrayV to spliceoffset
- the start index for the new arrayV chunklength
- the number of elements to remove / stop indexreplace
- the elements to add to the arrayVpublic static Value spliceImpl(Env env, Value var, ArrayValue array, int start, int end, ArrayValue replace)
public static Value array_sum(Env env, ArrayValue array)
array
- the array to sumpublic static Value array_udiff_assoc(Env env, Value[] arrays)
arrays
- first array is checked against the rest. Last element is the
callback function.public static Value array_udiff_uassoc(Env env, Value[] arrays)
arrays
- first array is checked against the rest. Last two elementare
the callback functions.public static Value array_udiff(Env env, Value[] arrays)
arrays
- first array is checked against the rest. Last element is the
callback function.public static Value array_uintersect_assoc(Env env, Value[] arrays)
arrays
- first array is checked against the rest. Last element is the
callback function.public static Value array_uintersect_uassoc(Env env, Value[] arrays)
arrays
- first array is checked against the rest. Last two elements
are the callback functions.public static Value array_uintersect(Env env, Value[] arrays)
arrays
- first array is checked against the rest. Last element is the
callback function.public static Value array_unique(Env env, ArrayValue array)
array
- the array to get rid of the duplicates frompublic static Value array_unshift(Env env, Value value, Value[] values)
array
- the array to shiftvalues
- public static Value array_values(Env env, ArrayValue array)
array
- the array to get the values frompublic static boolean array_walk_recursive(Env env, Value arrayVar, Callable callback, Value extra)
array
- the array to walkcall
- the name of the callback functionextra
- extra parameter required by the callback functionpublic static boolean array_walk(Env env, Value arrayVar, Callable callback, Value userData)
array
- the array to walk alongcallback
- the callback functionuserData
- extra parameter required by the callback functionpublic static boolean arsort(Env env, Value arrayVar, long sortFlag)
array
- the array to sortsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static boolean asort(Env env, Value arrayVar, long sortFlag)
array
- the array to sortsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static ArrayValue compact(Env env, Value[] variables)
variables
- contains the names of variables to add to the arraypublic static long count(Env env, Value value, int countMethod)
public static Value extract(Env env, ArrayValue array)
array
- the array contained the new variablespublic static Value extract(Env env, ArrayValue array, long rawType, Value valuePrefix)
array
- the array contained the new variablesrawType
- flag to determine how to handle collisionsvaluePrefix
- used along with the flagpublic static boolean in_array(Value needle, ArrayValue stack, boolean strict)
needle
- the array to sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static boolean krsort(Env env, Value arrayVar, long sortFlag)
array
- the array to sortsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static boolean ksort(Env env, Value arrayVar, long sortFlag)
array
- the array to sortsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static Value natcasesort(Env env, Value arrayVar)
array
- the array to sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static Value natsort(Env env, Value arrayVar)
array
- the array to sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static Value range(Env env, Value startV, Value endV, long step)
start
- the 0 index elementend
- the length - 1 index elementstep
- the new value is increased by this to determine the value for
the next elementpublic static boolean rsort(Env env, Value arrayVar, long sortFlag)
array
- the array to sortsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static long sizeof(Env env, Value value, int countMethod)
public static boolean sort(Env env, Value arrayVar, long sortFlag)
array
- the array to sortsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static boolean uasort(Env env, Value arrayVar, Callable func, long sortFlag)
array
- the array to sortfunc
- the name of the callback functionsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static boolean uksort(Env env, Value arrayVar, Callable func, long sortFlag)
array
- the array to sortfunc
- the name of the callback functionsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparablepublic static boolean usort(Env env, Value arrayVar, Callable func, long sortFlag)
array
- the array to sortfunc
- the name of the callback functionsortFlag
- provides optional methods to process the sortjava.lang.ClassCastException
- if the elements are not mutually comparable