<<< Previous question <<< Question ID#0710.md >>> Next question >>>
What happens if you execute the code below ?
class someclass {
public $someprop;
function __construct() {
$this->someprop = 1;
}
}
function somefunc(&$instance) {
unset($instance);
}
$instance = new someclass();
somefunc($instance);
var_dump($instance);
- A) object(someclass)#1 (1) { ["someprop"]=> int(1) }
- B) NULL
- C) Warning (Only variables can be passed by refence) NULL
- D) an error
Answer
Answer: A