|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-26 13:42 UTC] sniper@php.net
[2005-06-26 13:48 UTC] rvk at au dot ru
[2005-06-26 13:53 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 13:00:02 2025 UTC |
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)