David Rans

Results 7 comments of David Rans

Same issue here. If I upload a 180MB AVI file, Chrome consistently crashes with a memory error very soon after. The upload works fine on Firefox. I'll have to experiment...

Disabling `FileReader` fixed the issue for me. Large uploads were always crashing Chrome with a memory error before that fix.

FYI, this may be related: https://github.com/php/php-src/commit/7b9519a792a04d6943ff7082ff343a96ec00157f

Hmm, I'm not able to reproduce it in that environment either, though I was able to confirm that only passing the second param is an error in PHP 8.1 (and...

I believe the code I referenced in my issue is incorrect: https://github.com/squizlabs/PHP_CodeSniffer/blob/ed8e00df0a83aa96acf703f8c2979ff33341f879/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php#L58-L63 A type-hinted parameter with a default value of `NULL` _should_ be treated as an optional parameter.

Ah, so maybe this check just needs to get more sophisticated about checking the kind of typehint? And maybe augmented with a related check that enforces the recommended nullable type...

This fix resulted in a bunch of static function calls located at the top of files being deleted when running the rule across a large codebase.