BinaryNoFuncOverload.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Polyfill\Util;
  11. /**
  12. * @author Nicolas Grekas <p@tchwork.com>
  13. *
  14. * @internal
  15. */
  16. class BinaryNoFuncOverload
  17. {
  18. public static function strlen($s)
  19. {
  20. return \strlen($s);
  21. }
  22. public static function strpos($haystack, $needle, $offset = 0)
  23. {
  24. return strpos($haystack, $needle, $offset);
  25. }
  26. public static function strrpos($haystack, $needle, $offset = 0)
  27. {
  28. return strrpos($haystack, $needle, $offset);
  29. }
  30. public static function substr($string, $start, $length = PHP_INT_MAX)
  31. {
  32. return substr($string, $start, $length);
  33. }
  34. public static function stripos($s, $needle, $offset = 0)
  35. {
  36. return stripos($s, $needle, $offset);
  37. }
  38. public static function stristr($s, $needle, $part = false)
  39. {
  40. return stristr($s, $needle, $part);
  41. }
  42. public static function strrchr($s, $needle, $part = false)
  43. {
  44. return strrchr($s, $needle, $part);
  45. }
  46. public static function strripos($s, $needle, $offset = 0)
  47. {
  48. return strripos($s, $needle, $offset);
  49. }
  50. public static function strstr($s, $needle, $part = false)
  51. {
  52. return strstr($s, $needle, $part);
  53. }
  54. }