What does -> mean in PDO PHP?

mysql, pdo, php

Solution

The arrow is part of PHP's object syntax, it's saying:

$object->method();

In English is:

Run method on object

It's also used for accessing properties.

As PDO is a class in PHP and variables like `$db` are instances of that class, you're able to make use of the methods and properties in those instances.

Check out PHP's object docs for more info on the subject, and if you're new to Object Oriented programming then you'll need to research the subject.

Problem

I'm a complete beginner in learning PDO for PHP and I actually haven't learned MySQL or MySQLi yet. (Please take a look at the code below) I'm trying to make sense of what this " -> " arrow means and I couldn't find an answer anywhere else. Is the arrow semantically equivalent to the action word "perform" in every day english? E.G for the codes below, $stmt (perform) -> closeCursor(); Code: ``` $stmt = $db->prepare($sql); $stmt->execute(array($title,$entry)); $stmt->closeCursor(); ``` Thank you.

Original source

Related problems