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

Product Decisions This Supports

  • Enables reliable test isolation for code interacting with global variables (e.g., $_SESSION, $_SERVER), eliminating flaky tests caused by state leakage between test cases
  • Accelerates test infrastructure development by replacing custom global state management logic with a battle-tested solution, reducing engineering time and maintenance overhead
  • Critical for products requiring high-confidence test coverage (e.g., financial systems, healthcare platforms) where undetected side effects could lead to production defects
  • Supports roadmap goals for faster test execution cycles by automating state cleanup without manual setup/teardown boilerplate

When to Consider This Package

  • Adopt when: Your tests modify global state (e.g., superglobals, static variables), you use PHPUnit or similar testing frameworks requiring isolation, and your PHP version aligns with supported ranges (e.g., PHP 8.0-8.2 for v8.x)
  • Avoid when: Your
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