Rev 827 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 827 | Rev 874 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | <?php |
1 | <?php |
2 | declare(strict_types=1); |
2 | declare(strict_types=1); |
3 | namespace ParagonIE\ConstantTime; |
3 | namespace ParagonIE\ConstantTime; |
4 | 4 | ||
- | 5 | use TypeError; |
|
- | 6 | ||
5 | /** |
7 | /** |
6 | * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. |
8 | * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. |
7 | * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) |
9 | * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) |
8 | * |
10 | * |
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | * of this software and associated documentation files (the "Software"), to deal |
12 | * of this software and associated documentation files (the "Software"), to deal |
11 | * in the Software without restriction, including without limitation the rights |
13 | * in the Software without restriction, including without limitation the rights |
Line 62... | Line 64... | ||
62 | * @staticvar boolean $exists |
64 | * @staticvar boolean $exists |
63 | * @param string $str |
65 | * @param string $str |
64 | * @param int $start |
66 | * @param int $start |
65 | * @param ?int $length |
67 | * @param ?int $length |
66 | * @return string |
68 | * @return string |
- | 69 | * |
|
67 | * @throws \TypeError |
70 | * @throws TypeError |
68 | */ |
71 | */ |
69 | public static function safeSubstr( |
72 | public static function safeSubstr( |
70 | string $str, |
73 | string $str, |
71 | int $start = 0, |
74 | int $start = 0, |
72 | $length = null |
75 | $length = null |