title: PHP eval():: Use of undefined constant not_a_constant- assumed 'not_a_constant' php 7.2
body: <p>This code gives the warning of the title.
  Simplest solution would be to add the single quotes to "not_a_constant".
  This however break the "eval"
  I have tried concatenation of strings, etc.</p>
  
  <p>The eval SHOULD NOT BE removed.
  No auxiliary variables should be used.     </p>
  
  <pre><code>eval('$some_defined_var[not_a_constant] .= "' . some_function('some_string') . '";')
  </code></pre>
  
  <p>Please try this code defining some dumb vars and functions with php 7.2 to check the warning and possible solutions.</p>
  
  <p><strong>Edit</strong>
  1)Code standards forbids to use doble quotes for string.s
  2)We are trying to avoid scaping the single quotes inside the indexing in the "not_a_constant".
  This means, what I'm trying to achieve is this: </p>
  
  <blockquote>
    <p>$some_defined_var['not_a_constant']</p>
  </blockquote>