php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38217 ReflectionClass::newInstanceArgs() tries to allocate too much memory
Submitted: 2006-07-26 07:46 UTC Modified: 2006-07-26 08:03 UTC
From: alex at kiesel dot name Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5CVS-2006-07-26 (CVS) OS: FreeBSD 6.0
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: alex at kiesel dot name
New email:
PHP Version: OS:

 

 [2006-07-26 07:46 UTC] alex at kiesel dot name
Description:
------------
ReflectionClass::newInstanceArgs() tries to allocate huge pieces of memory, the engine dies because allowed memory size is exceeded.

Omitting the empty constructor makes the problem go away, so it might be related to that.

The error also occurs in PHP 5.1.4.

Reproduce code:
---------------
<?php
  class Object {
    public function __construct() {
    }
  }
  
  $class= new ReflectionClass('Object');
  var_dump($class->newInstanceArgs());
?>


Expected result:
----------------
PHP Warning:  ReflectionClass::newInstanceArgs() expects exactly 2 parameters, 1 given in /usr/home/alex/reflection_newinstance.php
object(Object)#2 (0) {
}


Actual result:
--------------
PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 550152752 bytes) in /usr/home/alex/reflection_newinstance.php on line 8


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-26 08:03 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC