|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.quercus.module.AbstractQuercusModule
com.caucho.quercus.lib.ArrayModule
public class ArrayModule
PHP array routines.
| Field Summary | |
|---|---|
static boolean |
CASE_INSENSITIVE
|
static int |
CASE_LOWER
|
static boolean |
CASE_SENSITIVE
|
static int |
CASE_UPPER
|
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
|
| Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule |
|---|
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER |
| Constructor Summary | |
|---|---|
ArrayModule()
|
|
| Method Summary | |
|---|---|
Value |
array_change_key_case(Env env,
ArrayValue array,
int toCase)
Changes the key case |
Value |
array_chunk(Env env,
ArrayValue array,
int size,
boolean preserveKeys)
Chunks the array |
Value |
array_combine(Env env,
ArrayValue keys,
ArrayValue values)
Combines array |
Value |
array_count_values(Env env,
ArrayValue array)
Counts the values |
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 |
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 |
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 |
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 |
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 |
ArrayValue |
array_fill_keys(Env env,
ArrayValue keyArray,
Value value)
|
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. |
Value |
array_filter(Env env,
ArrayValue array,
Callback callback)
Returns an array that filters out any values that do not hold true when used in the callback function. |
Value |
array_flip(Env env,
ArrayValue array)
Returns an array with the given array's keys as values and its values as keys. |
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 |
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 |
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. |
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. |
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 |
Value |
array_keys(Env env,
ArrayValue array,
Value searchValue,
boolean isStrict)
Returns an array of the keys in the given array |
Value |
array_map(Env env,
Callback fun,
ArrayValue arg,
Value[] args)
Maps the given function with the array arguments. |
Value |
array_merge_recursive(Value[] args)
Maps the given function with the array arguments. |
Value |
array_merge(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. |
Value |
array_pad(Env env,
ArrayValue input,
long padSize,
Value padValue)
Returns an array with either the front/end padded with the pad value. |
Value |
array_pop(Env env,
Value value)
Pops off the top element |
Value |
array_product(Env env,
ArrayValue array)
Returns the product of the input array's elements as a double. |
int |
array_push(Env env,
ArrayValue array,
Value[] values)
Appends a value to the array |
Value |
array_rand(Env env,
ArrayValue array,
long num)
Returns num sized array of random keys from the given array |
Value |
array_reduce(Env env,
ArrayValue array,
Callback callback,
Value initialValue)
Returns the value of the array when its elements have been reduced using the callback function. |
Value |
array_reverse(Env env,
ArrayValue inputArray,
boolean keyed)
Returns the inputted array reversed, preserving the keys if keyed is true |
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 |
Value |
array_shift(Env env,
ArrayValue array)
Shifts the elements in the array left by one, returning the leftmost value |
Value |
array_slice(Env env,
ArrayValue array,
long offset,
Value elements,
boolean presKeys)
Returns a chunk of the array. |
Value |
array_splice(Env env,
Value arrayVar,
int offset,
Value length,
Value replace)
Returns the removed chunk of the arrayV and splices in replace. |
Value |
array_sum(Env env,
ArrayValue array)
Returns the sum of the elements in the array |
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. |
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. |
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. |
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. |
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. |
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. |
Value |
array_unique(Env env,
ArrayValue array)
Returns the inputted array without duplicates |
Value |
array_unshift(Env env,
ArrayValue array,
Value[] values)
Prepends the elements to the array |
Value |
array_values(Env env,
ArrayValue array)
Returns the values in the passed array with numerical indices. |
boolean |
array_walk_recursive(Env env,
ArrayValue array,
Callback callback,
Value extra)
Recursively executes a callback function on all elements in the array, including elements of elements (i.e., arrays within arrays). |
boolean |
array_walk(Env env,
ArrayValue array,
Callback callback,
Value userData)
Executes a callback on each of the elements in the array. |
boolean |
arsort(Env env,
ArrayValue array,
long sortFlag)
Sorts the array based on values in reverse order, preserving keys |
static boolean |
asort(Env env,
ArrayValue array,
long sortFlag)
Sorts the array based on values in ascending order, preserving keys |
ArrayValue |
compact(Env env,
Value[] variables)
Creates an array of corresponding values to variables in the symbol name. |
static Value |
count(Env env,
Value value,
boolean recursive)
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 true for the mysql extension. |
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)
Undocumented alias for array_key_exists(com.caucho.quercus.env.Env, com.caucho.quercus.env.Value, com.caucho.quercus.env.Value). |
static Value |
key(Value value)
Returns the current key of the array. |
boolean |
krsort(Env env,
ArrayValue array,
long sortFlag)
Sorts the array based on keys in reverse order, preserving keys |
static boolean |
ksort(Env env,
ArrayValue array,
long sortFlag)
Sorts the array based on keys in ascending order, preserving keys |
static Value |
natcasesort(ArrayValue array)
Sorts the array based on string values using natural order, preserving keys, case insensitive |
static Value |
natsort(ArrayValue array)
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 value)
Returns the previous value of the array. |
Value |
range(Env env,
Value start,
Value end,
long step)
Creates an array using the start and end values provided |
static Value |
reset(Value value)
Resets the pointer |
boolean |
rsort(Env env,
ArrayValue array,
long sortFlag)
Sorts the array based on values in reverse order |
static Value |
shuffle(ArrayValue array)
Returns the current value of the array. |
static Value |
sizeof(Env env,
Value value,
boolean recursive)
Returns the size of the array. |
boolean |
sort(Env env,
ArrayValue array,
long sortFlag)
Sorts the array based on values in ascending order |
Value |
spliceImpl(Env env,
Value var,
ArrayValue array,
int start,
int end,
ArrayValue replace)
|
static boolean |
uasort(Env env,
ArrayValue array,
Callback func,
long sortFlag)
Sorts the array based on values in ascending order using a callback function |
static boolean |
uksort(Env env,
ArrayValue array,
Callback func,
long sortFlag)
Sorts the array based on values in ascending order using a callback function |
boolean |
usort(Env env,
ArrayValue array,
Callback func,
long sortFlag)
Sorts the array based on values in ascending order using a callback function |
| Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule |
|---|
getConstMap, getIniDefinitions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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 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
| Constructor Detail |
|---|
public ArrayModule()
| Method Detail |
|---|
public java.lang.String[] getLoadedExtensions()
getLoadedExtensions in interface QuercusModulegetLoadedExtensions in class AbstractQuercusModule
public Value array_change_key_case(Env env,
ArrayValue array,
int toCase)
public Value array_chunk(Env env,
ArrayValue array,
int size,
boolean preserveKeys)
public Value array_combine(Env env,
ArrayValue keys,
ArrayValue values)
public Value array_count_values(Env env,
ArrayValue array)
public Value array_pop(Env env,
Value value)
public static Value count(Env env,
Value value,
boolean recursive)
public static Value current(Value value)
public static Value key(Value value)
public static Value pos(Value value)
public static Value next(Value value)
public static Value each(Env env,
Value value)
public static Value prev(Value value)
public static Value reset(Value value)
public static Value shuffle(ArrayValue array)
public static Value end(Value value)
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 in
public static boolean key_exists(Env env,
Value key,
Value searchArray)
array_key_exists(com.caucho.quercus.env.Env, com.caucho.quercus.env.Value, com.caucho.quercus.env.Value).
public 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 array
public 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 with
public Value array_flip(Env env,
ArrayValue array)
array - the array to flip
public 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 space
public Value array_filter(Env env,
ArrayValue array,
Callback callback)
array - the array to filtercallback - the function name for filtering
public Value array_product(Env env,
ArrayValue array)
array - the array for who's product is to be found
public int array_push(Env env,
ArrayValue array,
Value[] values)
public 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 return
public Value array_reduce(Env env,
ArrayValue array,
Callback callback,
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 function
public Value array_reverse(Env env,
ArrayValue inputArray,
boolean keyed)
inputArray - the array to reversekeyed - true if the keys are to be preservered
public Value array_search(Env env,
Value needle,
ArrayValue array,
boolean strict)
needle - the value to search forarray - the array to searchstrict - checks for type aswell
public Value array_shift(Env env,
ArrayValue array)
array - the array to shift
public Value array_slice(Env env,
ArrayValue array,
long offset,
Value elements,
boolean presKeys)
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
otherwise
public 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 arrayV
public Value spliceImpl(Env env,
Value var,
ArrayValue array,
int start,
int end,
ArrayValue replace)
public Value array_sum(Env env,
ArrayValue array)
array - the array to sum
public Value array_unique(Env env,
ArrayValue array)
array - the array to get rid of the duplicates from
public Value array_unshift(Env env,
ArrayValue array,
Value[] values)
array - the array to shiftvalues -
public Value array_values(Env env,
ArrayValue array)
array - the array to get the values from
public boolean array_walk(Env env,
ArrayValue array,
Callback callback,
Value userData)
array - the array to walk alongcallback - the callback functionuserData - extra parameter required by the callback function
public boolean array_walk_recursive(Env env,
ArrayValue array,
Callback callback,
Value extra)
array - the array to walkcall - the name of the callback functionextra - extra parameter required by the callback function
public boolean arsort(Env env,
ArrayValue array,
long sortFlag)
array - the array to sortsortFlag - provides optional methods to process the sort
java.lang.ClassCastException - if the elements are not mutually comparable
public static boolean asort(Env env,
ArrayValue array,
long sortFlag)
array - the array to sortsortFlag - provides optional methods to process the sort
java.lang.ClassCastException - if the elements are not mutually comparable
public static boolean ksort(Env env,
ArrayValue array,
long sortFlag)
array - the array to sortsortFlag - provides optional methods to process the sort
java.lang.ClassCastException - if the elements are not mutually comparable
public boolean krsort(Env env,
ArrayValue array,
long sortFlag)
array - the array to sortsortFlag - provides optional methods to process the sort
java.lang.ClassCastException - if the elements are not mutually comparablepublic static Value natsort(ArrayValue array)
array - the array to sort
java.lang.ClassCastException - if the elements are not mutually comparablepublic static Value natcasesort(ArrayValue array)
array - the array to sort
java.lang.ClassCastException - if the elements are not mutually comparable
public boolean in_array(Value needle,
ArrayValue stack,
boolean strict)
needle - the array to sort
java.lang.ClassCastException - if the elements are not mutually comparable
public boolean sort(Env env,
ArrayValue array,
long sortFlag)
array - the array to sortsortFlag - provides optional methods to process the sort
java.lang.ClassCastException - if the elements are not mutually comparable
public boolean rsort(Env env,
ArrayValue array,
long sortFlag)
array - the array to sortsortFlag - provides optional methods to process the sort