ArrayKeyChoiceList deprecated::toArrayKey()

static int|string toArrayKey(mixed $choice)

Casts the given choice to an array key.

PHP arrays accept only strings and integers as array keys. Integer strings such as "42" are automatically cast to integers. The boolean values "true" and "false" are cast to the integers 1 and 0. Every other scalar value is cast to a string.

Parameters

mixed $choice The choice

Return Value

int|string The choice as PHP array key

Exceptions

InvalidArgumentException If the choice is not scalar
doc_Symfony
2016-10-28 06:05:53
Comments
Leave a Comment

Please login to continue.