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

Discussion forum for MOD Writers regarding MOD Development.
Locked
sal_jim
Registered User
Posts: 9
Joined: Tue Jun 11, 2013 12:13 pm
Contact:

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

Post 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';
    } 
User avatar
Steve
Registered User
Posts: 1092
Joined: Tue Apr 07, 2009 7:48 pm
Location: UK ,up north!!
Name: Steven Clark
Contact:

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

Post by Steve »

User avatar
AmigoJack
Registered User
Posts: 5745
Joined: Tue Jun 15, 2010 11:33 am
Location: γ‚°γƒͺーン ヒル ゾーン
Contact:

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

Post 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.
The worst thing about censorship is β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
Affin wrote: ↑
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.
Locked

Return to β€œ[3.0.x] MOD Writers Discussion”