0

Can someone explain what's the difference between methodA and methodB (with "&" sign) in PHP?

<?php
class X{
    public static function methodA(){return....;}

    public static function &methodB(){return....;}
}
?>
Mureinik
  • 252,575
  • 45
  • 248
  • 283

1 Answers1

0

Adding an & before the functions' name means it will return a reference instead of copying the return value back to the caller. You can find all the gritty details in the documentation.

Mureinik
  • 252,575
  • 45
  • 248
  • 283