php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33479 PHP crush when I use recursive function
Submitted: 2005-06-26 13:40 UTC Modified: 2005-06-26 13:53 UTC
From: rvk at au dot ru Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.4 OS: Windows 2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rvk at au dot ru
New email:
PHP Version: OS:

 

 [2005-06-26 13:40 UTC] rvk at au dot ru
Description:
------------
When i use function ati_add for array of class, it reproduce crash...

When i use this function for list of class only, it working correctly. 
Code
      $data[3] = ati_add($data[0], $data[1], $data[2]);
working perfectly.

Using PHP for Apache2 isapi module

Reproduce code:
---------------
<?php

class ati {
	var $data, $flag;
	function ati($data = null, $flag = null) {
		$this->data = $data;
		$this->flag = $flag;
	}
}

function ati_add() {
	$c = new ati();
	foreach(func_get_args() as $a) {
		if(is_a($a, 'ati')) {
			$c->data += $a->data;
			$c->flag &= $a->flag;
		} else {
			$c = ati_add($a);
		}
	}
	return $c;
}

$data[] = new ati(1,0);
$data[] = new ati(2,0);
$data[] = new ati(3,0);

$data[3] = ati_add($data);

echo $data[3]->data;

?>

Expected result:
----------------
I should see
6

Actual result:
--------------
Crash Apache with PHP (PHP working as isapi module)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-26 13:42 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2005-06-26 13:48 UTC] rvk at au dot ru
Sorry, really it`s my own bug
 [2005-06-26 13:53 UTC] tony2001@php.net
.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 19:01:36 2025 UTC