mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #79154: mb_convert_encoding() can modify $from_encoding
This commit is contained in:
commit
da9c206781
1 changed files with 34 additions and 0 deletions
34
ext/mbstring/tests/bug79154.phpt
Normal file
34
ext/mbstring/tests/bug79154.phpt
Normal file
|
@ -0,0 +1,34 @@
|
|||
--TEST--
|
||||
Bug 79154 (mb_convert_encoding() can modify $from_encoding)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('mbstring extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Utf8Encoding
|
||||
{
|
||||
public function __toString()
|
||||
{
|
||||
return 'UTF-8';
|
||||
}
|
||||
}
|
||||
|
||||
$utf8encoding = new Utf8Encoding();
|
||||
$encodings = [$utf8encoding];
|
||||
var_dump($encodings);
|
||||
mb_convert_encoding('foo', 'UTF-8', $encodings);
|
||||
var_dump($encodings);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Utf8Encoding)#%d (0) {
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Utf8Encoding)#%d (0) {
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue