php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4602 changing static variable in recursive function call has no effect after exiting
Submitted: 2000-05-26 06:09 UTC Modified: 2000-06-01 11:19 UTC
From: sprucely at hotmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 2 OS: Linux Mandrake 6.1
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sprucely at hotmail dot com
New email:
PHP Version: OS:

 

 [2000-05-26 06:09 UTC] sprucely at hotmail dot com
I had a static variable that I would add elements to as my function's recursion would go deeper. With RC1 and previous versions of PHP, changes to that static array inside recursive calls would still be there after those recursive calls exited. Not so with RC2 and the final release. I am now forced to use a global variable to store this temporary array.

This problem has occurred at two separate web hosts I'm using as they upgraded their versions of PHP - missoulaweb.com and phpwebhosting.com

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-01 11:19 UTC] stas at cvs dot php dot net
Fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 21:01:26 2024 UTC