From: Andrei Zmievski Date: Wed, 9 Feb 2000 19:41:13 +0000 (+0000) Subject: Return by reference, where necessary. X-Git-Tag: BEFORE_SAPIFICATION_FEB_10_2000~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab465c585798b64c3dd5b497159c1dbbeb6c49ae;p=php Return by reference, where necessary. --- diff --git a/pear/DB.php b/pear/DB.php index 186b95a094..a2ee775ed6 100644 --- a/pear/DB.php +++ b/pear/DB.php @@ -154,7 +154,7 @@ class DB { * a newly created DB object, or a DB error * code on error */ - function factory($type) { + function &factory($type) { global $USED_PACKAGES; // "include" should be replaced with "import" once PHP gets it $pkgname = 'DB/' . $type; @@ -167,7 +167,7 @@ class DB { } $classname = 'DB_' . $type; $obj = new $classname; - return $obj; // XXX ADDREF + return $obj; } // }}} @@ -188,12 +188,12 @@ class DB { * a newly created DB object, or a DB error * code on error */ - function connect($dsn, $persistent = false) { + function &connect($dsn, $persistent = false) { global $USED_PACKAGES; $dsninfo = DB::parseDSN($dsn); $type = $dsninfo['phptype']; - // "include" should be replaced with "use" once PHP gets it + // "include" should be replaced with "import" once PHP gets it $pkgname = 'DB/' . $type; if (!is_array($USED_PACKAGES) || !$USED_PACKAGES[$pkgname]) { if (!@include($pkgname . '.php')) { @@ -208,7 +208,7 @@ class DB { if (DB::isError($err)) { return $err; } - return $obj; // XXX ADDREF + return $obj; } // }}} @@ -354,7 +354,7 @@ class DB { } else { $parsed['phptype'] = $dsn; } - return $parsed; // XXX ADDREF + return $parsed; } if (preg_match('|^(.*)/([^/]+)/?$|', $dsn, &$arr)) { @@ -385,7 +385,7 @@ class DB { $parsed['dbsyntax'] = $parsed['phptype']; } - return $parsed; // XXX ADDREF + return $parsed; } // }}}