function Snapshot::snapshotGlobals
1 call to Snapshot::snapshotGlobals()
- Snapshot::__construct in vendor/
sebastian/ global-state/ src/ Snapshot.php
File
-
vendor/
sebastian/ global-state/ src/ Snapshot.php, line 202
Class
- Snapshot
- A snapshot of global state.
Namespace
SebastianBergmann\GlobalStateCode
private function snapshotGlobals() : void {
$superGlobalArrays = $this->superGlobalArrays();
foreach ($superGlobalArrays as $superGlobalArray) {
$this->snapshotSuperGlobalArray($superGlobalArray);
}
foreach (array_keys($GLOBALS) as $key) {
if ($key !== 'GLOBALS' && !in_array($key, $superGlobalArrays, true) && $this->canBeSerialized($GLOBALS[$key]) && !$this->excludeList
->isGlobalVariableExcluded($key)) {
/* @noinspection UnserializeExploitsInspection */
$this->globalVariables[$key] = unserialize(serialize($GLOBALS[$key]));
}
}
}