Advertisement
Guest User

rescue

a guest
Mar 29th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. function uopz_rescue_php()
  3. {
  4.     $search = uopz_copy('array_search');
  5.     uopz_function('array_search', function($haystack, $needle, $strict = false)
  6.         use ($search) {
  7.         return $search($needle, $haystack, $strict);
  8.     });
  9.     /** and so on **/
  10. }
  11.  
  12. function uopz_restore_php()
  13. {
  14.     uopz_restore('array_search');
  15.     /** and so on **/
  16. }
  17.  
  18. uopz_rescue_php();
  19.  
  20. $array = ["apples", "oranges", "pears"];
  21.  
  22. var_dump(array_search($array, "pears"));
  23.  
  24. uopz_restore_php();
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement