V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hopestar86
V2EX  ›  PHP

求教php类 function里参数前面的&符有啥作用?

  •  
  •   hopestar86 · Sep 27, 2012 · 4018 views
    This topic created in 4970 days ago, the information mentioned may be changed or developed.

    class splitPageResults {
    function splitPageResults(&$current_page_number, $max_rows_per_page, &$sql_query, &$query_num_rows) {
    .....

    }
    4 replies    1970-01-01 08:00:00 +08:00
    xlmo
        1
    xlmo  
       Sep 27, 2012
    按引用传递。
    qiayue
        2
    qiayue  
    PRO
       Sep 27, 2012
    PHP函数的参数,默认是传值的,如果你想传引用,就在该变量前加“&”符号。
    yetone
        3
    yetone  
       Sep 27, 2012
    我想说代码块,被 Ruby 『荼毒』了…
    holystrike
        4
    holystrike  
       Sep 27, 2012
    从来不用按引用传递
    相当evil
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1163 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 23:07 · PVG 07:07 · LAX 16:07 · JFK 19:07
    ♥ Do have faith in what you're doing.