php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12326 Resources (like a file descriptor) don't persist correctly
Submitted: 2001-07-23 23:27 UTC Modified: 2001-07-27 13:14 UTC
From: ivans at element dot hr Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.4 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2001-07-23 23:27 UTC] ivans at element dot hr
If you try session_remember()ing a variable that contains a resource, for instance one that you acquired via pfsockopen(), the value will be mangled, and the resource will become unavailable.

For instance:

<?
	session_start();
	echo gettype($socket),"<br>";
	if (!$socket) {
		$socket = fsockopen("www.php.net", 80);
		session_register("socket");
	}
	echo gettype($socket),"<br>";
?>

The second time you visit the page, the output is "integer<br>resource". It pretty much tells me that my resource gets saved as an integer, and then nobody remebers to turn it back into a resource again :(

Can this be done? Am I thinking in the wrong direction if I need file descriptor persistance?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC