Mantis - Quercus
Viewing Issue Advanced Details
3186 minor always 12-16-08 23:50 12-17-08 13:21
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003186: Saved state doesn't include list of include_once files
state.php:

<?php
if (! resin_restore_state()) {
  include_once 'state2.php';
  resin_save_state();
}
include_once 'state2.php';

state2.php:

<?php
if (true) {
  function foo() { }
}

The second time this is loaded, it dies and says "Fatal Error: function foo() is already defined."

It looks like if that file has a straight function declaration in global scope, that doesn't cause the problem, but any actual code gets executed even though the result of the code is already part of the global state. This will probably cause lots of unwanted side effects. I think the saved state should contain the list of files that have already been included.

Notes
(0003668)
nam   
12-17-08 13:21   
php/404j