From 7c18c09af25c1156eccd65d52fe590bc6f25f256 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Fri, 19 Apr 2024 11:39:42 +0200 Subject: [PATCH] feat: add captured flag property --- src/GlobalSnapshot.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GlobalSnapshot.php b/src/GlobalSnapshot.php index 4c2a917..a9cac1c 100644 --- a/src/GlobalSnapshot.php +++ b/src/GlobalSnapshot.php @@ -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]; }