php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20175 Array key -1 can crash PHP
Submitted: 2002-10-30 13:34 UTC Modified: 2002-11-10 11:53 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:0 of 0 (0.0%)
From: enigma at turingstudio dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.3.0-dev OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: enigma at turingstudio dot com
New email:
PHP Version: OS:

 

 [2002-10-30 13:34 UTC] enigma at turingstudio dot com
ola,

we've recently put in a set of methods in the binarycloud 
core classes so they can enforce their singleton status.

An example:

    // {{{ method GetInstance()

    /**
     * This method enforces this class's singleton
     * status. It check s astatic var for an instance,
     * if that instance exists a reference to it
     * is returned. If it does not exist it is created
     * and a reference is returned.
   	 * @author hans lellelid, hans@velum.net
	    * @access public
     */
    function &GetInstance() {
		    static $instance;
	    	if(!isset($instance)) {
	      		$instance = new Request();
	    	}        
      return $instance;
    }

    // }}}

note the line:

$instance = new Request();

that means the instance is always overwritten.

we have to do that because:

$instance =& new Request();

results in a null $instance.

We believe this is a bug, but it's on the edge of possible 
expected behavior.

thanks,

_alex


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-30 13:37 UTC] derick@php.net
Can you see if Zend Engine 2 solves this?

Derick
 [2002-10-30 14:07 UTC] enigma at turingstudio dot com
Heh,

I'm certain it does, but I'll ask andi on the list to check 
for us.
It would be reeeeeeally nice yo have for us in 4.2 though 
:)

Thanks for the quick response.

_a
 [2002-11-10 11:53 UTC] stas@php.net
This is fixed in CVS for ZE2. I don't think this would be fixed for ZE1, so I put it as wontfix for now. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 07:01:32 2024 UTC