CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  PHP

求解:值传递与引用传递中&如何定义与应用

楼主luckliaoyu(欣秋雨)2006-03-07 08:22:19 在 Web 开发 / PHP 提问

程序:  
  <html>  
  <head>  
  <title>值传递与引用传递</title>  
  </head>  
  <body>  
  <?php  
  function   swap($Var1,$Var2)  
  {  
  $VarTemp=$Var1;  
  $Var1=$Var2;  
  $Var2=$Vartemp;  
  }  
  $int1=1;  
  $int2=2;  
  swap($int1,$int2);  
  echo   "\$int1=$int1,\$int2=$int2<br>";  
  $int3=1;  
  $int4=2;  
  swap(&$int3,&$int4);  
  echo   "\$int3=$int3,\$iNt4=$int4<br>";  
  ?>  
  </body>  
  </html>  
  错误:  
  Warning:   Call-time   pass-by-reference   has   been   deprecated   -   argument   passed   by   value;   If   you   would   like   to   pass   it   by   reference,   modify   the   declaration   of   swap().   If   you   would   like   to   enable   call-time   pass-by-reference,   you   can   set   allow_call_time_pass_reference   to   true   in   your   INI   file.   However,   future   versions   may   not   support   this   any   longer.   in   c:\appserv\www\include\p\p4-3.php   on   line   19  
   
  Warning:   Call-time   pass-by-reference   has   been   deprecated   -   argument   passed   by   value;   If   you   would   like   to   pass   it   by   reference,   modify   the   declaration   of   swap().   If   you   would   like   to   enable   call-time   pass-by-reference,   you   can   set   allow_call_time_pass_reference   to   true   in   your   INI   file.   However,   future   versions   may   not   support   this   any   longer.   in   c:\appserv\www\include\p\p4-3.php   on   line   19  
  $int1=1,$int2=2  
  $int3=2,$int4=  
  请问各位大虾如何解决问题,我是一个刚刚学习PHP的新手.  
  请问&如何在PHP.INI中定义才能使用. 问题点数:20、回复次数:1Top

1 楼gu1dai(异域苍穹.百年飞行)回复于 2006-03-07 09:07:13 得分 20

function   swap(&$Var1,&$Var2)  
  {  
  $VarTemp=$Var1;  
  $Var1=$Var2;  
  $Var2=$Vartemp;  
  }  
   
  $int3=1;  
  $int4=2;  
  swap($int3,$int4);  
  echo   "\$int3=$int3,\$iNt4=$int4<br>";Top

相关问题

  • 请问将一个form作为一个过程的参数进行传递,该如何定义,如何引用?
  • pb6.5中如何将ole引用的mscomm控件传递给自定义全局函数!
  • jsp参数传递的问题求解??
  • 中文传递问题(求解)
  • 用户定义类引用??
  • 菜鸟提问,有关引用定义... :)
  • 引用类未定义,为什么?
  • 用户自定义算术表达式的求解
  • 急,如何在win2000下设自定义纸张?100分求解
  • 高分求解:DataGrid自定义排序问题

关键词

  • 传递

得分解答快速导航

  • 帖主:luckliaoyu
  • gu1dai

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo