search

Home  >  Q&A  >  body text

How to use => and ->?

What scenarios should these two => and -> be used in?

那山那山2619 days ago1162

reply all(2)I'll reply

  • 逗比孩儿不动手

    逗比孩儿不动手2017-09-30 21:39:10

    => is a key-value pair

    -> is similar to (.) in java. It means the equivalent of calling. For example, $a->$b(); means calling the b() function of an object. ;

    reply
    0
  • LRTRL

    LRTRL2017-09-29 08:58:23

    => is used to connect the key-value pairs in the array, -> is used to call methods or variables

    reply
    0
  • Cancelreply