title: Environment specific services config in Symfony 3.4
body: <p>I need to access some private services via the container while in the <code>dev</code> environment.</p>
  
  <p>I thought it would be simple - I'd just make them public specifically for <code>dev</code> like so:</p>
  
  <p><strong>app/config/services.yml:</strong></p>
  
  <pre><code>services:
      _defaults:
          autowire: true
          autoconfigure: true
          public: false
  
      MyBundle\:
          resource: '../../*'
          exclude: '../../{Entity,Repository,DoctrineMigrations,DependencyInjection,Tests,Util}'
  </code></pre>
  
  <p><strong>app/config/services_dev.yml:</strong></p>
  
  <pre><code>imports:
  - { resource: services.yml }
  
  services:
    _defaults:
      autowire: true
      autoconfigure: true
      public: true
  </code></pre>
  
  <p><strong>app/config/config_dev.yml</strong></p>
  
  <pre><code>imports:
      - { resource: config.yml }
      - { resource: services_dev.yml }
  </code></pre>
  
  <p>This however does not yield the desired result: services behave as if private, config is not merged at all(e.g. when you have parameter injection, sy yells that I must define them explicitly, even if the parent config already does).</p>
  
  <p>There's plenty of examples, in the default config of Sy, where specific parameters get overridden for various environments, but for some reason this does not seem to be the case for services. Is the services config processed in a special way somehow? Have I misunderstood something? What's going on here?</p>
  
  <p>P.S. I know about dependency injection, I know accessing the container is considered bad practice, that's not the point of the question. Please do not suggest that.</p>