Imho, `$name` should be escaped too. From shell point of view `php '-d=name=value'` is the same as `php -d='name=value'`.