How to dictate a PHP function with typed parameters
PHP parameters carry a dollar prefix, which binds rightward onto the name. VoiceGem turns “function camel case get user open paren dollar sign camel case user id close paren open brace” into function getUser($userId) { with nothing to clean up.
A thirteen-word PHP declaration is about 15 seconds of typing against about 4.8 seconds of speech. (sources: Dhakal, Feit, Kristensson & Oulasvirta, “Observations on Typing from 136 Million Keystrokes”, CHI 2018, 168,000 participants, 136 million keystrokes; Yuan, Liberman & Cieri, “Towards an Integrated Understanding of Speaking Rate in Conversation”, Interspeech 2006, 2,438 American English telephone conversations (Switchboard corpus). The speech figure is conversational rate, not a measured dictation rate — no such measurement exists.)
function getUserRecord($userId, $includeDeleted) {This tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.
Step by step
- 1
Say “function” then a casing command
Speak “function camel case get user record”. The keyword passes through and the casing command builds the name from the three following words.
- 2
Prefix every parameter with “dollar sign”
Say the phrase before each parameter name. VoiceGem's dollar sign attaches rightward, so it binds onto the identifier the casing command builds with no space between them.
- 3
Say “thin arrow” for member access
Use the qualified phrase in the body. The bare word “arrow” produces the fat arrow, which is PHP's array-key operator and parses in the wrong place.
- 4
By hand instead
Type Shift-4 before each variable. PHP developers do this constantly and are entitled to find speaking it slower — the value is in the identifier names, not the prefix.
PHP function signatures dictate with no cleanup at all
Every character in a PHP declaration has attach flags that suit it. The dollar sign binds rightward onto the parameter name, the brackets bind tightly, the comma leaves a trailing space, and the braces keep their spacing — so the signature arrives exactly as a PHP formatter would leave it.
The one trap is not in the signature. PHP member access uses the thin arrow, and VoiceGem's unqualified word “arrow” reaches the fat arrow instead, which is also a valid PHP operator — so the error produces working syntax with the wrong meaning rather than a parse failure.
Where the manual way breaks
A PHP developer already types the dollar sign without thinking, and a short function is faster by hand. Adding two syllables before every variable is a genuine cost for a fluent typist.
Method chains are the case worth speaking. A repository call chained through two thin arrows with a camelCase method name at each step is four identifiers and four punctuation marks, and the identifiers are most of the typing. Dictating the chain in VoiceGem builds each name from a casing command in one pass.
Doing this somewhere else? speech-to-code converter, with nothing to install, dictating Bash functions specifically, dictating Go functions specifically, or how dictating Java methods works.
Common questions
No. Every character involved has VoiceGem attach flags that suit PHP, so the declaration arrives as a formatter would leave it.
Because the fat arrow is also a valid PHP operator. Saying “arrow” instead of “thin arrow” produces working syntax with the wrong meaning rather than an error.
Say the type as a plain word, then “dollar sign” and a casing command. The type is not in the lookup table so it passes through untouched.
Yes. The thin arrow attaches on neither side, so a chain arrives as $this -> repository. The signature needs no cleanup; the body does.
Dictate a two-step method chain and check both arrows.
Open the tool