Bug #12326: Resources (like a file descriptor) don't persist correctly

From: Date: Tue, 24 Jul 2001 03:27:14 +0000
Subject: Bug #12326: Resources (like a file descriptor) don't persist correctly
Groups: php.dev 
Request: Send a blank email to php-dev+get-60824@lists.php.net to get a copy of this message
From: ivans@element.hr Operating system: Windows 2000 Server PHP version: 4.0.4 PHP Bug Type: Session related Bug description: Resources (like a file descriptor) don't persist correctly 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? -- Edit bug report at: http://bugs.php.net/?id=12326&edit=1

« previous php.dev (#60824) next »