Browse Source

removing references from backend functions. lookup causes E_NOTICE in php
4.4.0, because tries to return array(). Use of references can't be explained.
Main backend class and file/ldap backends don't use refencences. If it is
used for some reason, other lookup() should have to use references too.
I suspect that reason is performance or it is relict from some different code.
PHP manual says that developers should not use references in order to increase
performance.

tokul 20 years ago
parent
commit
f859fe157e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      functions/abook_database.php

+ 3 - 3
functions/abook_database.php

@@ -179,7 +179,7 @@ class abook_database extends addressbook_backend {
      * @param string $expr search expression
      * @return array search results
      */
-    function &search($expr) {
+    function search($expr) {
         $ret = array();
         if(!$this->open()) {
             return false;
@@ -228,7 +228,7 @@ class abook_database extends addressbook_backend {
      * @param string $alias alias
      * @return array search results
      */
-    function &lookup($alias) {
+    function lookup($alias) {
         if (empty($alias)) {
             return array();
         }
@@ -266,7 +266,7 @@ class abook_database extends addressbook_backend {
      * List all addresses
      * @return array search results
      */
-    function &list_addr() {
+    function list_addr() {
         $ret = array();
         if (!$this->open()) {
             return false;