|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-11-10 08:07 UTC] memory dot agape at gmail dot com
Description:
------------
Call "new static()" on __destruct will say segmentation fault
-----
[1] 17385 segmentation fault php test.php
-----
Test script:
---------------
<?php
class A
{
public function __destruct()
{
new static();
}
}
new A();
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 11:00:01 2025 UTC |
I think to have to same expect "__construct" Test Script: --- <?php class A { public function __construct() { new static(); } } new A(); ---- Expect: --- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /path/to/test.php on line 7 ---