f2 / globals
Provides a function `F2\globals(string $namespace):array` that allow you to save data without polluting the `$_GLOBALS` superglobal.
1.0.5
2019-12-29 00:27 UTC
Requires (Dev)
- f2/asserty: ^1.0
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");
}