Classes - Always References

    Date: 03/08/05 (PHP Community)    Keywords: no keywords

    Are classes always references when assigning them to new variables? Or are copies of the class made? I'd assume the former.

    For example:

    $HTTP_SESSION_VARS['user'] = new User();

    Later in a function foo() which assign statement should I use? And does it matter?

    $user = $HTTP_SESSION_VARS['user'];

    or

    $user = &$HTTP_SESSION_VARS['user'];

    TIA.

    Source: http://www.livejournal.com/community/php/269928.html

« Quotes - Single or Double || JAMA (for PHP) »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home