You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since PHP 5, if not earlier, the length of an array is internally stored by PHP
and can be accessed in O(1) time.
Maintaining both the array and its length in class properties is error-prone
(particularly regarding possible future code changes).
When used in a loop, `\count($array)` is more repetitively expensive than
`$arrayLength`,
but the latter can be set up as a local variable as and when needed.
Reference:
https://stackoverflow.com/questions/5835241/is-phps-count-function-o1-or-on-for-arrays
This change also ensures that the characters are always a (dazzling) array.
And adds a type parameter to `ParserState::setCharset()`,
which was unavoidably required.
Resolves#953.
0 commit comments