f2/globals

Provides a function `F2\globals(string $namespace):array` that allow you to save data without polluting the `$_GLOBALS` superglobal.

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/f2/globals

1.0.5 2019-12-29 00:27 UTC

This package is auto-updated.

Last update: 2025-09-29 02:57:36 UTC


README

Micro library enabling sharing of state without introducing global variables or using the $_GLOBALS super-global.

Using:

<?php
use function F2\globals;

function example() {
    $globals = &globals("package/name");

    print_r($globals);
    $globals[] = date("Y-m-d H:i:s");
}