$skinValue); $_COOKIE = array(); eval($block); return array($skin, $css); } $failures = 0; function check($name, $got, $want) { global $failures; if ($got === $want) { echo "ok - $name\n"; } else { echo "FAIL - $name (got ".var_export($got, true).", want ".var_export($want, true).")\n"; $failures++; } } $cases = array( 'classic' => 'classic', '..' => $first, '../includes' => $first, '../../../tmp' => $first, 'nonexistent' => $first, ); foreach ($cases as $name => $want) { $got = run($name); check($name, $got[0], $want); } $got = run(array('x')); check('array(x)', $got[0], $first); exit($failures ? 1 : 0); }