|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-10-23 16:00 UTC] andi at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 04:00:01 2026 UTC |
Assigning by reference to a variable passed by reference to a function works only inside the function but not outside <? function testme(&$ref1,&$ref2) { global $top; $ref1 = $top; $ref2 = &$top; print "top:'".$top. "' ,ref1:'".$ref1. "' ,ref2:'".$ref2. "'<br>"; } $top = "hallo"; $x="x is unchanged"; $y="y is unchanged"; testme($x,$y); print "top:'".$top."', x:'".$x."', y:'".$y."'<br>"; ?> prints top:'hello' ,ref1:'hello' ,ref2:'hello' top:'hello', x:'hello', y:'y is unchanged' instead if the expected top:'hello' ,ref1:'hello' ,ref2:'hello' top:'hello', x:'hello', y:'hello' --- 8< --- configure'd with: ./configure --with-mysql --enable-track-vars --with-imap --- 8< --- php.ini looks like this [PHP] engine = On short_open_tag = On asp_tags = Off precision = 14 y2k_compliance = Off safe_mode = Off highlight.string = #DD0000 highlight.comment = #FF8000 highlight.keyword = #007700 highlight.bg = #FFFFFF highlight.default = #0000BB highlight.html = #000000 allow_builtin_links = Off max_execution_time = 30 memory_limit = 8388608 error_reporting = 7 display_errors = On log_errors = Off track_errors = Off warn_plus_overloading = Off magic_quotes_gpc = Off magic_quotes_runtime = Off magic_quotes_sybase = Off track_vars = Off [Syslog] define_syslog_variables = Off [mail function] SMTP = localhost sendmail_from = me@localhost.com sendmail_path = /usr/lib/sendmail -t [Debugger] debugger.host = localhost debugger.port = 7869 debugger.enabled = False [SQL] sql.safe_mode = Off [MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 [Session] session.save_handler = files session.save_path = /tmp session.name = PHPSESSID session.auto_start = 0 session.lifetime = 0 session.serialize_handler = php session.gc_probability = 10 session.gc_maxlifetime = 1800