Bug #11924 Updated: problem with ibase_execute called through call_user_func_array()
| From: | derick@php.net | Date: | Sun, 26 May 2002 08:35:06 +0000 |
| Subject: | Bug #11924 Updated: problem with ibase_execute called through call_user_func_array() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-8572@lists.php.net to get a copy of this message | ||
ID: 11924
Updated by: derick@php.net
Reported By: flying@dom.natm.ru
Status: Feedback
Bug Type: InterBase related
Operating System: Windows 2000
PHP Version: 4.0.6
New Comment:
Which code example exactly? Can you show me the full script (As short
as possible).
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-05-25 09:54:04] flying@dom.natm.ru
> I'd like to know the output of:
> var_dump (get_func_args()) in ibase_execute... this is your > own
function, isn't it?
No, it is InterBase module function :)
http://www.php.net/manual/en/function.ibase-execute.php
This bug is still present in 4.2.1, that code example returns me:
Array
(
[0] => Resource id #2
[1] => some text
[2] => amother text
)
Array
(
[0] => Resource id #2
[1] => 0
[2] => amother text
)
As you can see - contents of array with index 1 is changes, while they
should not.
------------------------------------------------------------------------
[2002-05-25 09:41:40] derick@php.net
ok, nm :)
I'd like to know the output of:
var_dump (get_func_args()) in ibase_execute... this is your own
function, isn't it?
Derick
------------------------------------------------------------------------
[2002-05-25 09:27:25] flying@dom.natm.ru
Sorry, but i don't understand your question...
------------------------------------------------------------------------
[2002-05-25 09:21:56] derick@php.net
Who would you want to do something like this?
------------------------------------------------------------------------
[2001-07-06 06:03:08] flying@dom.natm.ru
It seems to be a problem when ibase_execute called indirectly, through
call_user_func_array().
Look at the following piece of code:
$args = array('some text','amother text');
$query = ibase_prepare($conn,"insert into MY_TABLE (INT_FIELD,
STR_FIELD) values (?,?)");
array_unshift($args,$query);
print_r($args);
$rs = call_user_func_array('ibase_execute',$args);
print_r($args);
ibase_free_query($query);
MY_TABLE table contains two columns:
INT_FIELD INTEGER,
STR_FIELD VARCHAR(50)
Imagine, that we're make an error, and pass string values for both
fields.
No error will be given, but at second print_r() first item inro $args
array
will be equal to 0 instead of 'some text'.
As I can understand, all query parameters are replaced by values,
actually
stored into database (like they are passed by reference,
but allow_call_time_pass_reference options is turned off).
If it is not a bug, but a "feature", it must be documented, to avoid
future misunderstandings.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=11924&edit=1