<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Unsetting References</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="language.references.return.html">Returning References</a></div> <div class="next" style="text-align: right; float: right;"><a href="language.references.spot.html">Spotting References</a></div> <div class="up"><a href="language.references.html">References Explained</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="language.references.unset" class="sect1"> <h2 class="title">Unsetting References</h2> <p class="para"> When you unset the reference, you just break the binding between variable name and variable content. This does not mean that variable content will be destroyed. For example: <div class="informalexample"> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$a </span><span style="color: #007700">= </span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$b </span><span style="color: #007700">=& </span><span style="color: #0000BB">$a</span><span style="color: #007700">;<br />unset(</span><span style="color: #0000BB">$a</span><span style="color: #007700">); <br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> won't unset <var class="varname"><var class="varname">$b</var></var>, just <var class="varname"><var class="varname">$a</var></var>. </p> <p class="simpara"> Again, it might be useful to think about this as analogous to the Unix <strong class="command">unlink</strong> call. </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="language.references.return.html">Returning References</a></div> <div class="next" style="text-align: right; float: right;"><a href="language.references.spot.html">Spotting References</a></div> <div class="up"><a href="language.references.html">References Explained</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>