ae4d1a0def
Somehow the JIT doesn't hit this codepath, but with interp mode the param is a string, but we think `callable` means an object of type callable. I hate to hadd another top-level if statement to every call. Would a switch statement on the type be better?
24 linhas
319 B
PHP
24 linhas
319 B
PHP
<?php
|
|
|
|
function check($f) {
|
|
var_dump($f);
|
|
var_dump(is_callable($f));
|
|
}
|
|
|
|
function typehint(callable $a) {
|
|
var_dump('worked');
|
|
}
|
|
|
|
function id() {}
|
|
|
|
function main() {
|
|
check('');
|
|
check('id');
|
|
check('blarblah');
|
|
|
|
$cl = function() { return 'closure'; };
|
|
typehint($cl);
|
|
typehint('id');
|
|
}
|
|
main();
|