|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-24 00:37 UTC] felipe@php.net
-Status: Open
+Status: Bogus
[2010-05-24 00:37 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 13:00:01 2025 UTC |
Description: ------------ I know it's wrong to try to instantiate a class within it's own constructor, yet I thought that I should report the crashing of the php interpreter. Perhaps this case may expose an area of the interpreter that may cause other problems. Here is a sample script. <?php class a {function __construct(){new a();}} new a(); # - kills php ?> Here is the message produced (with php 5.3.2): Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261904 bytes) in M:\workspace\html\directAbrasives\lib\t.php on line 1 Here is my php version: PHP 5.3.2 (cli) (built: Mar 3 2010 20:47:01) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies Running this code on PHP 5.2 didn't generate any message at all. Also, I tried a catching exceptions, yet it appears that none are thrown in this case. I am operating on WindowsXP. Cheers. -g Test script: --------------- <?php class a {function __construct(){new a();}} new a(); # - kills php ?> Expected result: ---------------- Some kind of error message with a line number saying you can't do this. Actual result: -------------- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261904 bytes) in M:\workspace\html\directAbrasives\lib\t.php on line 1