Advanced PHP |
 |
2025-02-27 |
 |
 |

57 |
 |
 |
If your function takes an array parameter. You can check it and access
it like this:
Here the call to zend_parse_parameters() does the type check. If
the user passes a non-array to this function s/he will get a message that looks like this:
foo.php(4) : Warning - my_arr() expects argument 1 to be array, integer given
If you wanted to write a function that could take either an array of integers
or perhaps a single integer and have your function figure it out automatically
you do do it like this:
The possible types are: