php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12110 odbc_fetch_into behaves like variables are not decl to be passed by reference
Submitted: 2001-07-12 13:21 UTC Modified: 2001-07-12 13:48 UTC
From: MrVanes at Bigfoot dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.6 OS: win2000
Private report: No CVE-ID: None
 [2001-07-12 13:21 UTC] MrVanes at Bigfoot dot com
I'm am not sure if this is only odbc related. It might be only the function where this problem turned up for me...

Example of odbc_fetch_into call that stopped working from 4.0.6:

43
44  while (@odbc_fetch_into($query_id, 0, $result_array)) {
45     list($var1, $var2) = $result_array;
46     ...
47  }
48

Running this script results in an error:
Fatal error: Only variables can be passed by reference in D:\Inetpub\wwwroot\bb\location.php on line 44

Fortunately some of my scripts call odbc_fetch_into a little different:
Example of odbc call that still works in 4.0.6:

09
10  function db_fetch_into($id, $number) {
11  	@odbc_fetch_into($id, $number, $result_array);
12  	return $result_array;
13  }
14
15  while (list($var1, $var2) = db_fetch_into($query_id, 0)) {
16    ...
17  }
18

PHP.INI:
allow_call_time_pass_reference = Off

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-12 13:48 UTC] derick@php.net
This is not a bug, but a known inconsistency. It will be adressed when the language will be cleaned up (For 4.1 or maybe 5.0)

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC