![]() ![]() | ![]() |
1.1 ! misho 1: --TEST-- ! 2: callback function is a closure ! 3: --SKIPIF-- ! 4: <?php if (!extension_loaded("filter")) die("skip"); ?> ! 5: --FILE-- ! 6: <?php ! 7: $callback = function ($var) { ! 8: return $var; ! 9: }; ! 10: $var = "test"; ! 11: var_dump(filter_var($var, FILTER_CALLBACK, array('options'=> $callback))); ! 12: ?> ! 13: --EXPECT-- ! 14: string(4) "test"