feat: add captured flag property (#2)

This commit is contained in:
Victor Westerlund 2024-04-19 09:43:51 +00:00 committed by GitHub
parent a5e39a44e9
commit 80cb5d17b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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