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
  • 297,002
  • 52
  • 306
  • 350

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
  • 297,002
  • 52
  • 306
  • 350