Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<?php
class A
{
}
function test_1(A[] $a)
{
/* ... */
}
function test_2($a)
{
foreach($a as $tmp_obj)
{
if(!($tmp_obj instanceof A))
{
throw new Exception('...');
}
}
/* ... */
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment