php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2015 static php3 incompatibility
Submitted: 1999-08-09 19:21 UTC Modified: 1999-11-22 23:09 UTC
From: sander at pilon dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 2 OS: Linux 2.2
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: sander at pilon dot com
New email:
PHP Version: OS:

 

 [1999-08-09 19:21 UTC] sander at pilon dot com
	function 	test()
	{
		static $test1;
		echo "BEFORE: $test1 <BR>";
		
		unset($test1);
		
		$test1 = "Hello";		
		echo "AFTER: $test1 <BR>";
	}		

        test(); test();

Output:

BEFORE: 
AFTER: Hello 
-- 
BEFORE: 
AFTER: Hello 

Should be: 
BEFORE: 
AFTER: Hello 
-- 
BEFORE: Hello
AFTER: Hello 

Works fine if you remove the unset();
Works fine in PHP3.


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-22 23:09 UTC] zeev at cvs dot php dot net
known incompatibility - unset() in PHP 4.0 unsets the reference
to the static variable, rather than the static variable itself.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC