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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sertyoan at osyra dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 04:01:29 2025 UTC