1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/standard/tests/strings/gh18823_weak.phpt
Niels Dossche c4183fba00 Fix GH-19070: setlocale($type, NULL) should not be deprecated
This restores the old behaviour.

Closes GH-19071.
2025-07-10 22:01:16 +02:00

32 lines
577 B
PHP

--TEST--
GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types) - weak mode
--INI--
error_reporting=E_ALL
--FILE--
<?php
class MyStringable {
public function __toString(): string {
return 'foo';
}
}
class MyStringableThrow {
public function __toString(): string {
throw new Error('no');
}
}
setlocale(LC_ALL, 0, "0");
setlocale(LC_ALL, "0", 0);
setlocale(LC_ALL, null);
setlocale(LC_ALL, new MyStringable);
try {
setlocale(LC_ALL, new MyStringableThrow);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
no