sebastianbergmann/global-state

Snapshotting of global state, factored out of PHPUnit into a stand-alone component

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 48 minutes ago
Added to GitGenius on September 10th, 2026
Created on August 22nd, 2014
Open Issues & Pull Requests: 1 (+0)
GitHub issues: Enabled
Number of forks: 19
Total Stargazers: 6,592 (+0)
Total Subscribers: 6 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.

Related repositories by overlapping contributors

No overlapping-contributor repos identified yet.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 118 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (1)
  • type/dependencies (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Global State is a PHP library that captures and restores snapshots of global state for testing purposes.

The library solves the problem of test isolation when code under test modifies global variables, superglobals, or other shared state that could affect other tests. It works by taking snapshots of the current state of globals, superglobals, static properties, and other global elements before test execution, then restoring them afterward. This approach allows tests to run independently without side effects from global state mutations leaking between test cases.

Developers working with PHP test suites should consider this tool when their codebase relies on global state and they need to ensure test isolation without manually resetting each global variable. It is particularly suited for legacy codebases or frameworks that make heavy use of globals, where manual cleanup would be tedious or error-prone. The library was factored out of PHPUnit, so it integrates naturally with PHPUnit-based testing workflows, though it can be used as a standalone component in other testing contexts.

The project maintains a focused scope with infrequent but deliberate updates, suggesting stable, mature code that does not require constant changes. Issues and pull requests receive responses, indicating active maintenance and responsiveness to user needs. The codebase appears well-established and reliable for production use in test infrastructure.