|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79626 arrow fucntion memory leak
Submitted: 2020-05-25 06:35 UTC Modified: 2020-05-25 07:04 UTC
From: thedinosaurmail at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.4.6 OS: ubuntu 16.
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: thedinosaurmail at gmail dot com
New email:
PHP Version: OS:


 [2020-05-25 06:35 UTC] thedinosaurmail at gmail dot com
arrow function and  anonymous functions  should be garbage collect ,but it seems  be the full  life cycle  

it may relative with this 

Test script:
// file1.php
for ($i = 0; $i < 1000000; $i++)
// file2.php

$fn1 = fn($x) => $x + $y;

above wil oom
below will not  oom 

// file3.php
for ($i = 0; $i < 1000000; $i++)
$fn1 = fn($x) => $x + $y;

Expected result:
not  report fatal error

Actual result:
Fatal error: Allowed memory size of 134217728 bytes exhausted at /root/php-src/Zend/zend_hash.c:149 (tried to allocate 384 bytes) in /home/dinosaur/test/php746/bin/file2.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-25 06:40 UTC] thedinosaurmail at gmail dot com
-Summary: memory leak +Summary: arrow fucntion memory leak
 [2020-05-25 06:40 UTC] thedinosaurmail at gmail dot com
the same problem with it
 [2020-05-25 07:04 UTC]
-Status: Open +Status: Duplicate -Package: *General Issues +Package: Scripting Engine problem -Assigned To: +Assigned To: cmb
 [2020-05-25 07:04 UTC]
Indeed, duplicate of bug #76982.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 07:01:29 2024 UTC