www.webdeveloper.com
Results 1 to 3 of 3

Thread: what does the & symbol mean here? function $ funcNam() { ..

  1. #1
    Join Date
    Mar 2010
    Posts
    281

    what does the & symbol mean here? function $ funcNam() { ..

    not sure if i've come across this before or not. this is from a class file of a shopping cart i'm
    currently having to working with

    function & getStaticProperty($var)
    {
    static $staticProperty;
    return $staticProperty;
    }


    what does the '&' symbol mean??,

    thanks

  2. #2
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    That is very odd. It is typically called the referencing operator, (a reference to a value in memory as opposed to a value itself).

    I'm not sure what it means in this situation... What PHP version are you running?
    I use (, ; : -) as I please- instead of learning the English language specification: I decided to learn Scheme and Java;

  3. #3
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    http://php.net/manual/en/language.references.return.php

    it's returning a reference to a static value. Keep in mind PHP uses a reference counting system for garbage collection. I don't see any reason to do this, perhaps this code was written as some type of 'work around' in an older version of PHP.
    I use (, ; : -) as I please- instead of learning the English language specification: I decided to learn Scheme and Java;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles