committed by
Nikita Popov
4 changed files with 64 additions and 46 deletions
-
2NEWS
-
22ext/standard/tests/general_functions/is_callable_anon.phpt
-
78ext/standard/tests/general_functions/is_callable_variation1.phpt
-
8ext/standard/type.c
@ -0,0 +1,22 @@ |
|||
--TEST-- |
|||
Test is_callable() function : usage variations - anonymous class method |
|||
--FILE-- |
|||
<?php |
|||
|
|||
new class { |
|||
function __construct() { |
|||
$fname = null; |
|||
if (is_callable([$this, 'f'], false, $fname)) { |
|||
call_user_func($fname); |
|||
} else { |
|||
echo "dang\n"; |
|||
} |
|||
} |
|||
function f() { |
|||
echo "nice\n"; |
|||
} |
|||
}; |
|||
|
|||
?> |
|||
--EXPECT-- |
|||
nice |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue