php-eval: unexpected '=' in drush/commands/core/core.drush.inc(658)

Created on 8 July 2010, almost 14 years ago
Updated 8 May 2023, about 1 year ago

Including an = inside quote marks breaks php-eval apparently:

$ drush php-eval '$blah = "blah\n"; print($blah);'
blah
$ drush php-eval "$blah = 'blah\n'; print($blah);"
PHP Parse error:  syntax error, unexpected '=' in /usr/local/share/drush/commands/core/core.drush.inc(658) : eval()'d code on line 1

Any idea why? This isn't a killer, but it can be annoying if you're testing a bunch of code or something.

πŸ’¬ Support request
Status

Fixed

Version

6.0

Component

Base system (internal API)

Created by

πŸ‡¦πŸ‡ΊAustralia naught101

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024