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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Thu May 02 13:01:30 2024 UTC