Functions Index :: A :: ArrayGetValueRegisterNewHandler

[<< up one level]

Module:

array :: core

Definition:

ArrayGetValueRegisterNewHandler(string new_handler)

Description:

Makes new_handler the new array value-retrieve handler function by assigning it to the ArrayGetValueHandler global variable.

Returns the previous value of the variable.

The assignment is made only if the passed argument is callable, as decided by the IsCallable() library function.

Note that this is a global setting affecting immediately all subsequent operations on arrays.

Examples:

function my_array_get_handler(...) {...}

...

oldhandler = ArrayGetValueRegisterNewHandler("my_array_get_handler")

# perform your custom array operations here

...

# if afterwards you want the previous behavior, reset the old handler

dummy = ArrayGetValueRegisterNewHandler(oldhandler)

 

[<< top]

  $notes