I call “-” minus.
I call “=” equal.
For example, in the code below
try {
$dbc = new PDO("mysql:host=localhost;dbname=$dbName;charset=utf8", "root", "*******", $options);
} catch(PDOException $e) {
throw new PDOException($e->getMessage(), (int)$e->getcode());
}
I calls “=” “equal” in the above.
I don’t know how to call " → ".
How do you call it?
I can call it “arrow to rightward” but I think it’s very long when I read the code.
How do you call " → "?
In the PHP world, there’s arrays and there’s objects. Arrays in PHP are called or referenced in similar ways to other programming languages. This being enclosed in square brackets (e.g. ['value']). Objects on the other hand are something entirely different. They are referenced by instantiating a class which holds that object. Objects have something I call “visibility scopes” (public, protected, private) which tells the language what it can access and what it can’t. Arrays don’t have such a thing because arrays are what you can consider, a list of items. You can consider objects as a noun.
Pretty sure you are not asking how to use → or what it is. You just want to know how to ‘pronounce’ it when reading code. And I don’t have a good answer for that.
For some reason I always call it “underscore equals” when mentally reading code. Which of course makes no sense at all but it hard to break 40 years (same operator is used in C/C++) of habit.
The quotes above are goog information to understand and remember. Thank you.
By the way, there are, I guess, something unclear in my original question.
I heard that native speaker of English pronounces SQL as sequel.
My original question was how you do pronounce " → " instead of "how do you call " → ".
Sequel is a common way of saying SQL in actual speech, yes. The Standard says it’s pronounced as the acronym, ess-cue-ell.
How do you call "->"
Normally, I wouldnt. It’s like a comma, you dont say the word “comma” in the middle of your sentence unless you’re dictating.
It would depend on the context of the sentence as to how I would phrase $e->getcode(). Most likely, “On the error object call getcode”. So you could say in that sentence I was saying “call”, but if it was a property ($a->member), I would probably say something like “Get the member from a” or “a’s member” (In which case the → becomes the possessive, I suppose). If i was dictating a script, I would call it an arrow.
Like I said in the other topic you started, it has many names. In C++ and C, most people call it the “arrow operator”. Others have a different name for it.
Interesting question though, as I don’t know what to call it, though I would probably call it an arrow.
But the comma has a name, “comma”.
For ages, I never knew that. I think because I very rarely speak (as in actual speech) to other developers, so never heard it said. I mostly (certainly starting out learning) work alone and communication is usually in writing, such as in the forums here. So when I have spoken about it, it seems strange to me.
Throw another odd one at you - my natural tendency changes depending on the context. I will pronounce “SQL” as “Sequel”, but “MySQL” as “My Ess Cue Ell”.