| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2002-05-26 13:21 UTC] ivun at mail dot ru
 The article about unset() says: "If a globalized variable is unset() inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset() was called." It is != true! PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 02:00:01 2025 UTC | 
Sure. My script works with sockets and there is a function that closes the socket and destroys all the variables connected to it. $output and $input are arrays of sockets. Here is the code: function socket_kill_my_socket($i) { global $fset, $output, $input; $fnd = array_search($i, $fset); unset($fset[$fnd]); unset($output[$i]); unset($input[$i]); socket_shutdown($i); //??? socket_close($i); echo "Closed $i<BR>"; }