/ Published in: HTML
PHP: The Basics - Manual
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<pre> <?php $assigned = $instance; $reference =& $instance; $instance->var = '$assigned will have this value'; $instance = null; // $instance and $reference become null var_dump($instance); var_dump($reference); var_dump($assigned); ?> <hr> The above example will output: NULL NULL object(SimpleClass)#1 (1) { ["var"]=> string(30) "$assigned will have this value" } </pre>