Edit report at http://bugs.php.net/bug.php?id=51896&edit=1

 ID:               51896
 Updated by:       fel...@php.net
 Reported by:      RocketInABog at techno-monks dot net
 Summary:          class a {function __construct(){new a();}} new a(); #
                   - kills php
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Reproducible crash
 Operating System: Windows XP
 PHP Version:      5.3SVN-2010-05-23 (SVN)

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:
------------------------------------------------------------------------
[2010-05-24 00:32:45] RocketInABog at techno-monks dot net

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




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51896&edit=1

Reply via email to