Bug #11658 Updated: Getting values by reference don't work
| From: | phanto@php.net | Date: | Tue, 26 Jun 2001 14:19:03 +0000 |
| Subject: | Bug #11658 Updated: Getting values by reference don't work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58064@lists.php.net to get a copy of this message | ||
ID: 11658
Updated by: phanto
Reported By: andrej.aschenbrenner@face.de
Status: Open
Bug Type: COM related
Operating system:
PHP Version: 4.0.6
Assigned To:
Comments:
$user = "test_user";
$allowed = new VARIANT(8, VT_I4|VT_BYREF);
$instance = new COM("dll.CObject") or die("Unable to
instanciate dll.CObject");
$instance->CheckLogin($user, COM_REMOTE_SERVER, $allowed);
echo $allowed->value;
/* you can use $allowed->type to check it against
* VT_* constants
* look into the php documentation for more flags
* passing variables by reference is a deprecated
* zend feature (i don't know why) and it didn't work
* in every case in earlier versions.
*/
Previous Comments:
---------------------------------------------------------------------------
[2001-06-26 07:00:49] sniper@php.net
The #11660 was already bogused. Reopened this one.
---------------------------------------------------------------------------
[2001-06-25 17:21:56] jeroen@php.net
Was submitted twice. Dup. of 11660
---------------------------------------------------------------------------
[2001-06-25 09:00:11] andrej.aschenbrenner@face.de
Example:
$user = "test_user";
$allowed = 8;
$instance = new COM("dll.CObject") or die("Unable to
instanciate dll.CObject");
$instance->CheckLogin($user, COM_REMOTE_SERVER, &$allowed);
echo $allowed;
$allowed has always the value that you have specified
above, here: 8; When I change $allowed to 6788, then
I get 6788. It seems that the variable won't be changed
when you pass it by reference.
It doesn't matter if i use the & sign or not!
Note that the variable $allowed have to be integer,
I can't pass a variant type to the COM-Function CheckLogin.
The same has been working with previous versions of PHP,
until 4.0.5 and above.
In need this functionality because i use a lot of stuff
like that:
$instance->some_function(&$var1, &$var2, &$var3);
any clue, what's going up?
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11658&edit=2