note 43094 added to language.references.pass
| From: | php at meKILLTHIStatoandthisols dot org | Date: | Wed, 09 Jun 2004 16:33:23 +0000 |
| Subject: | note 43094 added to language.references.pass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70412@lists.php.net to get a copy of this message | ||
Ever been in a situation where you have to write:
<?php
$t = 1 ;
$x =& $t ;
?>
or
<?php
$t = 1 ;
f( $t ) ;
?>
because you cannot pass constants by value. The function
<?php
function& pclone( $v ) {
return( $v ) ;
}
?>
lets you get ridd of the temporary variable. You can write:
<?php
$x =& pclone( 1 ) ;
?>
or
<?php
f( pclone( 1 ) ) ;
?>
Alternatively you can use the other alternative ;-)
----
Manual Page -- http://www.php.net/manual/en/language.references.pass.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43094
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43094&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43094&report=yes
Search -- http://master.php.net/manage/user-notes.php