- Standard:
. Fixed bug #76342 (file_get_contents waits twice specified timeout).
(Thomas Calvet)
+ . Fixed bug #78612 (strtr leaks memory when integer keys are used and the
+ subject string shorter). (Nikita)
26 Sep 2019, PHP 7.2.23
len = ZSTR_LEN(key_used);
if (UNEXPECTED(len > slen)) {
/* skip long patterns */
+ zend_string_release(key_used);
continue;
}
if (len > maxlen) {
--- /dev/null
+--TEST--
+Bug #78612 (strtr leaks memory when integer keys are used and the subject string shorter).
+--FILE--
+<?php
+
+$find_replace = array();
+$_a = 7111222333000001;
+$_b = 5000001;
+
+for ($j=0; $j<10; $j++) {
+ $find_replace[$_a + $j] = $_b + $j;
+}
+
+echo strtr('Hello', $find_replace), "\n";
+
+?>
+--EXPECT--
+Hello