php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45261 No error raised on cyclic class creation
Submitted: 2008-06-13 14:10 UTC Modified: 2008-06-16 06:51 UTC
From: sertyoan at osyra dot net Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.2.6 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
9 + 38 = ?
Subscribe to this entry?

 
 [2008-06-13 14:10 UTC] sertyoan at osyra dot net
Description:
------------
When creating an object which has as property an object of the same class - this creates an infinite loop -, the page doesn't display (that's normal) but no error is raised.

Reproduce code:
---------------
class A {
 private $B;

 public function __construct() {
  $this->B = new A();
 }
}

Expected result:
----------------
PHP should bug and raise an error.

Actual result:
--------------
Nothing. Blank page and no error raised.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-15 18:27 UTC] crrodriguez at suse dot de
This is the "expected" behaviour. it will crash in 5_2 and will reach the memory limit in 5_3 and print

Fatal error: Allowed memory size of %d bytes exhausted at..
 [2008-06-16 06:51 UTC] sertyoan at osyra dot net
Ok. Let's close it so. Sorry for polluting bugs list.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 02:01:28 2024 UTC