Test string:
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
PHP: str_slice($s) -> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
PHP: str_slice($s, 0, 0) -> ""
PHP: str_slice($s, 1, 0) -> ""
PHP: str_slice($s, -1, 0) -> ""
PHP: str_slice($s, 1, 1) -> ""
PHP: str_slice($s, -1, -1) -> ""
PHP: str_slice($s, 0, -50) -> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin lit
PHP: str_slice($s, 0, 50) -> Contrary to popular belief, Lorem Ipsum is not sim
PHP: str_slice($s, 0, -10000) -> ""
PHP: str_slice($s, 0, 10000) -> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
PHP: str_slice($s, 50) -> ply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
PHP: str_slice($s, 100, -40) -> cal Latin literature fr
PHP: str_slice($s, -100, -30) -> xt. It has roots in a piece of classical Latin literature from 45 BC,
PHP: str_slice($s, 0, 2) -> Co
PHP: str_slice($s, 0, -2) -> Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years ol
PHP: str_slice($s, 3, 4) -> t
PHP: str_slice($s, 2) -> ntrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
PHP: str_slice($s, -2) -> d.
PHP: str_slice($s, 2, -2) -> ntrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years ol
PHP: str_slice($s, -5, -2) -> ol
PHP: str_slice($s, -5, 7) -> ""
PHP: str_slice($s, -5, -7) -> ""
Performance tests:
PHP: str_slice($s) -> 0.004053 ms
PHP: str_slice($s, 0, 0) -> 0.001907 ms
PHP: str_slice($s, 1, 0) -> 0.001907 ms
PHP: str_slice($s, -1, 0) -> 0.002861 ms
PHP: str_slice($s, 1, 1) -> 0.004053 ms
PHP: str_slice($s, -1, -1) -> 0.002861 ms
PHP: str_slice($s, 0, -50) -> 0.002861 ms
PHP: str_slice($s, 0, 50) -> 0.003099 ms
PHP: str_slice($s, 0, -10000) -> 0.004053 ms
PHP: str_slice($s, 0, 10000) -> 0.002861 ms
PHP: str_slice($s, 50) -> 0.003099 ms
PHP: str_slice($s, 100, -40) -> 0.004053 ms
PHP: str_slice($s, -100, -30) -> 0.004053 ms
PHP: str_slice($s, 0, 2) -> 0.002861 ms
PHP: str_slice($s, 0, -2) -> 0.003099 ms
PHP: str_slice($s, 3, 4) -> 0.002861 ms
PHP: str_slice($s, 2) -> 0.003099 ms
PHP: str_slice($s, -2) -> 0.003099 ms
PHP: str_slice($s, 2, -2) -> 0.003815 ms
PHP: str_slice($s, -5, -2) -> 0.004053 ms
PHP: str_slice($s, -5, 7) -> 0.003099 ms
PHP: str_slice($s, -5, -7) -> 0.004053 ms
PHP: str_slice Total Time -> 0.07176ms