note 33082 modified in ref.com by danbrown
| From: | danbrown@php.net | Date: | Mon, 21 Dec 2009 17:15:56 +0000 |
| Subject: | note 33082 modified in ref.com by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164231@lists.php.net to get a copy of this message | ||
Passing parameters by reference in PHP 4.3.2 (and in a future releases of PHP )
In PHP 4.3.2 allow_call_time_pass_reference option is set to "Off" by default and future
versions may not support this option any longer.
Some COM functions has by-reference parameters. VARIANT object must be used to call this functions,
but it would be passed without an '&' before variable name.
Example:
<?php
$myStringVariant = new VARIANT("over-write me", VT_BSTR);
/* works */
$result = $comobj->DoSomethingTo($myStringVariant );
/* works only with allow_call_time_pass_reference option set to "On" and may not work in a
future release of PHP */
$result = $comobj->DoSomethingTo(&$myStringVariant );
/* The value in the variant can be retrieved by: */
$theActualValue = $myStringVariant->value;
?>
--was--
Passing parameters by reference in PHP 4.3.2 (and in a future releases of PHP )
In PHP 4.3.2 allow_call_time_pass_reference option is set to "Off" by default and future
versions may not support this option any longer.
Some COM functions has by-reference parameters. VARIANT object must be used to call this functions,
but it would be passed without an '&' before variable name.
Example:
$myStringVariant = new VARIANT("over-write me", VT_BSTR);
/* works */
$result = $comobj->DoSomethingTo($myStringVariant );
/* works only with allow_call_time_pass_reference option set to "On" and may not work in a
future release of PHP */
$result = $comobj->DoSomethingTo(&$myStringVariant );
The value in the variant can be retrieved by:
$theActualValue = $myStringVariant->value;
http://php.net/manual/en/ref.com.php