PHP - can a method return a pointer?
- by Kerry
I have a method in a class trying to return a pointer:
<?php
public function prepare( $query ) {
// bla bla bla
return &$this->statement;
}
?>
But it produces the following error:
Parse error: syntax error, unexpected '&' in /home/realst34/public_html/s98_fw/classes/sql.php on line 246
This code, however, works:
<?php
public function prepare( $query ) {
// bla bla bla
$statement = &$this->statement;
return $statement;
}
?>
Is this just the nature of PHP or am I doing something wrong?