|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-09-03 14:38 UTC] sjon@php.net
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 19:00:01 2025 UTC |
Small additional reduction: <?php function coerceToString(string ...$strings) { var_dump($strings); } coerceToString(...[123]);