Method Pike.switch_lookup()


Method switch_lookup

int switch_lookup(array|mapping switch_table, mixed val)

Description

Lookup a switch-case.

Parameter switch_table

Lookup table as generated by the compiler.

Parameter val

Value to lookup.

Returns

Returns the entry number (ie >= 0) if val was found in switch_table, and the binary inverse of the next entry number (ie < 0) if it was not found.