php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7488 Pass-by-reference problem
Submitted: 2000-10-27 05:07 UTC Modified: 2001-04-18 22:33 UTC
From: torben@php.net Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0 Latest CVS (27/10/2000) OS: Mandrake 7.0
Private report: No CVE-ID: None
 [2000-10-27 05:07 UTC] torben@php.net
When calling odbc_fetch_into() with three arguments, all works as 
expected: the result array is passed by reference and results are 
placed into it. But when using the two-parameter form, the result
array becomes the second parameter, which must be passed like this:

  odbc_fetch_into($rid, &$arr);

in order to have the results placed into $arr. If the & is left out, $arr
is not modified. However, using & results in the large compile-time error
being printed at the beginning of script output unless it's been masked
out in php.ini, since forcing pass-by-ref this way is no longer supported.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-27 10:49 UTC] kalowsky@php.net
is this still the case?
 [2001-03-27 15:31 UTC] torben@php.net
Yup. Here's a breakdown:

Using & | allow_call_time_pass_by_reference | Works? | Err?
-----------------------------------------------------------
  Yes   |              On                   |  Yes   | No
  No    |              On                   |  No    | No
  Yes   |              Off                  |  Yes   | Yes
  No    |              Off                  |  No    | No

Which is weird. When I get the error telling me that my
arg has been passed by value, it's actually been passed
by reference.

I also think perhaps that it's just generally a bad idea
for a function to depend upon deprecated features of the
language, since at the moment it requires call-time 
pass-by-ref to work.

 [2001-04-18 22:33 UTC] kalowsky@php.net
tested your supplied patch, and it seems to be working on Windows, so I'm commiting.  Please have others test too!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC