Bug #80049 [NEW]: memleak when coercing integers to string
| From: | sjon@php.net | Date: | Thu, 03 Sep 2020 14:38:37 +0000 |
| Subject: | Bug #80049 [NEW]: memleak when coercing integers to string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228862@lists.php.net to get a copy of this message | ||
From: sjon
Operating system: archLinux
PHP version: 8.0.0beta3
Package: *General Issues
Bug Type: Bug
Bug description:memleak when coercing integers to string
Description:
------------
I hope this fixes the majority of the 900 memleaks we currently have in
our application
Test script:
---------------
class sa
{
public static function coerceTo(string $type, array $array): array
{
return self::_coerceToString(...array_values($array));
}
protected static function _coerceToString(string ...$strings):
array
{
return $strings;
}
}
sa::coerceTo("string", ['nl' => 0.9, 'be' => 0.2]);
Actual result:
--------------
Zend/zend_string.h(141) : Freeing 0x00007fb91a281300 (224 bytes),
script=/tmp/memleak.php
Last leak repeated 1 time
--
Edit bug report at https://bugs.php.net/bug.php?id=80049&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80049&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80049&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80049&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80049&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80049&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80049&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80049&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80049&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80049&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80049&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80049&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80049&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80049&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80049&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80049&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80049&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80049&r=mysqlcfg