/tests/php/ia/call_user_func.php
PHP | 23 lines | 11 code | 6 blank | 6 comment | 0 complexity | ba8c87e190995de8dc460efb6fe4e208 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, LGPL-3.0, ISC
- <?php
- function foo($x) {
- var_dump($x);
- }
- function bar($x) {
- var_dump($x);
- }
- $t = 'foo';
- // this one will be ok
- call_user_func($t, 5);
- //APPROX:
- // this one will not because $t will have been generalized to a Tstring
- //$t = 'bar';
- //call_user_func($t, 6);
- // this is ok because it's another variable
- $t2 = 'bar';
- call_user_func($t2, 6);