balancer/pattern-hash-array

v0.0.1 2017-06-21 06:59 UTC

This package is auto-updated.

Last update: 2020-07-10 13:42:43 UTC


README

Simple pattrn hash array demo for https://www.linux.org.ru/forum/development/13492726

$hash = new PatternHashArray();

$hash[['^(any|key|be|no|key)$', PatternHashArray::REGEXP]] = 'value';
$hash['hello'] = 'world';
$hash[['foo*bar', PatternHashArray::GLOB]] = 'Dummy staff';

dump(
	$hash['any'],
	$hash['hello'],
	$hash['fooizmus lebart'],
	$hash['fooizmus lebar']
);

Result:

"value"
"world"
NULL
"Dummy staff"