Skip to content

Instantly share code, notes, and snippets.

@KalleZ
Created October 31, 2017 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KalleZ/c7ba4f78314c989e27710e4fa14e2f3e to your computer and use it in GitHub Desktop.
Save KalleZ/c7ba4f78314c989e27710e4fa14e2f3e to your computer and use it in GitHub Desktop.
<?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