Page 1 of 1

what are two operators (=> , ->) called?

Posted: Thu Aug 08, 2013 10:55 am
by sal_jim
what are following two operators in PHP called?; need to search internet for its simple info and correct usage. Do not understand what they do.

First operator is
->

Second operator is
=>

source:

Code: Select all

    
if ($forum_id == 104)
    {
        $sort_by_text = array('t' => $user->lang['TOPIC_TITLE']);
        $sort_by_sql = array('t' => 't.topic_title');
        $sort_dir = 'a';
    } 

Re: what are two operators (=> , ->) called?

Posted: Thu Aug 08, 2013 11:41 am
by Steve

Re: what are two operators (=> , ->) called?

Posted: Thu Aug 08, 2013 11:46 am
by AmigoJack
PHP support is beyond the scope of phpBB.
  1. php.net/operator
  2. See the link operator precedence which also lists which operator has which meaning in general.
  3. => is for (array key) assignments.
  4. (not listed) -> is the object operator (object oriented programming) to relate objects and methods/properties.