Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Global State Laravel Package

sebastian/global-state

sebastian/global-state snapshots and restores PHP global state (globals, superglobals, ini settings, etc.), extracted from PHPUnit as a standalone component. Useful for test isolation and detecting side effects by capturing state before and after code runs.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: Minimal. This package is a PHPUnit dependency for snapshotting global state during tests. Laravel's built-in testing utilities (e.g., TestCase, Mockery, Faker) already abstract global state handling via PHPUnit's internals, making direct usage redundant. Laravel's architecture favors dependency injection and service container mocking over direct global state manipulation, reducing the need for this package.

Integration feasibility: Low. As a transitive dependency of PHPUnit (which Laravel already uses), it requires no direct Composer integration. Attempting to use it directly would violate Laravel's testing best practices and could introduce fragile test code. The package's PHP version constraints (e.g., no PHP 8.3 support in v9.0.0) create compatibility risks if Laravel's required PHP versions diverge from the package's support matrix.

Technical risk: High for misuse. Intentional direct usage in application code would introduce security and stability risks (e.g., modifying $_ENV or $_SERVER during runtime). Even in tests, over-reliance on global state snapshotting indicates poor test design (e.g., unmocked dependencies, side-effect-heavy code). The "0 dependents" statistic suggests limited real-world usage outside PHPUnit internals, increasing uncertainty about edge-case behavior.

Key questions:

  • Why would Laravel developers need this outside of
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport