File: 0001-uopz_set_static.phpt

package info (click to toggle)
php-uopz 7.1.1%2B%2B-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 688 kB
  • sloc: ansic: 2,137; xml: 335; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
uopz_set_static with array
--EXTENSIONS--
uopz
--INI--
uopz.disable=0
--FILE--
<?php
class Foo {
	public static function bar () {
		static $baz = null;
		if (is_null ($baz)) { $baz = time (); }
		return $baz;
	}
}

var_dump(Foo::bar());
uopz_set_static ('Foo', 'bar', ['baz' => 1]);
var_dump(Foo::bar());
?>
--EXPECTF--
int(%d)
int(1)