mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

When micro-benchmarking on relatively short ASCII strings, the new implementation was about 30% faster than the old one.
30 lines
447 B
PHP
30 lines
447 B
PHP
--TEST--
|
|
mb_parse_str() error handling
|
|
--EXTENSIONS--
|
|
mbstring
|
|
--FILE--
|
|
<?php
|
|
mb_internal_encoding('UTF-8');
|
|
|
|
$queries = array(
|
|
"\x80\x80\x80",
|
|
"\xFF=\xFF"
|
|
);
|
|
|
|
foreach ($queries as $query) {
|
|
echo "Query: " . bin2hex($query) . "\n";
|
|
|
|
$array = [];
|
|
mb_parse_str($query, $array);
|
|
|
|
foreach ($array as $key => $value) {
|
|
echo bin2hex($key) . "=>" . bin2hex($value) . "\n";
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Query: 808080
|
|
3f3f3f=>
|
|
Query: ff3dff
|
|
3f=>3f
|