Home  >  Q&A  >  body text

What does -> mean in PHP

What does -> in PHP mean? I just learned it and don’t understand anything. Please explain it to me. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

PHP中文网用户-2307495PHP中文网用户-2307495398 days ago737

reply all(2)I'll reply

  • WBOY

    WBOY2023-08-15 10:23:21

    The arrow symbol "->" is used to access the properties and methods of the object.

    It means getting properties or calling methods from an object. For example, suppose there is an object named $obj that has a property named $property and a method named $method.

    can be accessed using arrow symbols:

    $obj->property;  // 访问对象的属性
    $obj->method();  // 调用对象的方法

    reply
    0
  • 李栋

    Can you add WeChat to ask questions about GraphQL? V: dongli3023

    李栋 · 2023-09-05 21:01:50
  • Cancelreply