Long php://filter Chains Are Deprecated
A php://filter URL can chain several filters with |. Until PHP 8.6, any number of filters could be chained silently. In PHP 8.6, opening a php://filter URL with more than 16 chained filters emits a deprecation notice suggesting the max_filter_count stream context option or stream_filter_append() instead.
PHP code
<?php
$filters = str_repeat('string.toupper|', 20);
$handle = fopen('php://filter/read='.$filters.'/resource=php://memory', 'r');
var_dump($handle !== false);
?>
Before
bool(true)
After
PHP Deprecated: Using more than 16 filters in a php://filter URL is deprecated, set this limit using the stream context option max_filter_count, or use stream_filter_append in /codes/filterChainCountDeprecated86.php on line 4
Deprecated: Using more than 16 filters in a php://filter URL is deprecated, set this limit using the stream context option max_filter_count, or use stream_filter_append in /codes/filterChainCountDeprecated86.php on line 4
bool(true)
PHP version change
This behavior was deprecated in 8.6.
This behavior changed in .