feat: add captured flag property

This commit is contained in:
Victor Westerlund 2024-04-19 11:39:42 +02:00
parent a5e39a44e9
commit 7c18c09af2

View file

@ -22,6 +22,8 @@
private array $argv; private array $argv;
private ?array $__composer_autoload_files; // Native support for composer private ?array $__composer_autoload_files; // Native support for composer
public bool $captured = false;
public function __construct() {} public function __construct() {}
// Wipe all superglobals // Wipe all superglobals
@ -42,6 +44,8 @@
// Store current state of superglobals // Store current state of superglobals
public function capture() { public function capture() {
$this->captured = true;
foreach (array_keys($GLOBALS) as $global) { foreach (array_keys($GLOBALS) as $global) {
$this->{$global} = $GLOBALS[$global]; $this->{$global} = $GLOBALS[$global];
} }