Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Basically, the difference between an <code>E_WARNING</code> and an <code>E_COMPILE_WARNING</code> is that <code>E_COMPILE_WARNING</code> is generated while the script is still compiling.</p> <p><code>E_COMPILE_WARNING</code> is similar to <code>E_COMPILE_ERROR</code> in that it is generated during compile time, but an <code>E_COMPILE_WARNING</code> does not prevent script execution the way <code>E_COMPILE_ERROR</code> does. Compare it to the the relation between <code>E_ERROR</code> and <code>E_WARNING</code>, where the former halts execution, and the latter allows execution to continue.</p> <p>For example, the following code generates an <code>E_COMPILE_WARNING</code>:</p> <pre><code>&lt;?php echo "\n"; echo "Hello World"; echo "\n\n"; var_dump(error_get_last()); declare(foo='bar'); ?&gt; </code></pre> <p>output:</p> <pre><code>Warning: Unsupported declare 'foo' in e_compile_warning.php on line 6 Hello World array(4) { ["type"]=&gt; int(128) ["message"]=&gt; string(25) "Unsupported declare 'foo'" ["file"]=&gt; string(124) "e_compile_warning.php" ["line"]=&gt; int(6) } </code></pre> <p>Notice how the warning is displayed before the other output (even though "Hello World" came first in the source), and the <code>var_dump</code> statement on line 5 references an error that occurs on line 6. PHP compiles the script, doesn't like <code>declare(foo='bar');</code>, but goes back and executes the script anyway (as opposed to an <code>E_COMPILE_ERROR</code> like <code>$this = 2;</code>, which would stop execution (and compilation) immediately).</p> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload