#12326 [Com]: Resources (like a file descriptor) don't persist correctly

From: Date: Tue, 20 Jul 2004 15:11:23 +0000
Subject: #12326 [Com]: Resources (like a file descriptor) don't persist correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63062@lists.php.net to get a copy of this message
ID: 12326 Comment by: art-bdsm225 at hotmail dot com Reported By: ivans at element dot hr Status: Bogus Bug Type: Session related Operating System: Windows 2000 Server PHP Version: 4.0.4 New Comment: <a href=http://all-sweat-poohardco.da.ru>art bdsm</a> Previous Comments: ------------------------------------------------------------------------ [2001-07-27 13:14:52] sniper@php.net RTFM: http://www.php.net/manual/en/function.session-register.php :) ------------------------------------------------------------------------ [2001-07-23 23:27:14] 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? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=12326&edit=1

« previous php.bugs (#63062) next »