From 7076343338ae3439f3c86f01144818abe8c31978 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 07:16:23 +0200 Subject: add container helpers; constuct public directory-tree --- tests/abstract.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/abstract.php (limited to 'tests/abstract.php') diff --git a/tests/abstract.php b/tests/abstract.php new file mode 100644 index 0000000..2b085a4 --- /dev/null +++ b/tests/abstract.php @@ -0,0 +1,46 @@ + 10, + 'to' => [20, 220], + 'tree' => [30, [330, 3330]] + ]; + + public static function foo($who) { + print_r(static::$abs[$who]); + } + +} + +class Xtra extends abs { + + public static $abs = [ + 'Oh' => 'Yoo hoo!', + 'my' => ['babe', 'be', 'mine'] + ]; + + // overide method + public static function foo($who) { + print_r(['overiding', $who, 'my']); + } + +} + +class Repo extends abs { + public static $abs = [ + 'one' => 1, + 'to' => [2, 22], + 'tree' => [3, [33, 333]] + ]; +} + +class Neva extends abs { + // use abstract's (default) array +} + +Xtra::foo('Oh'); +Repo::foo('to'); +Neva::foo('tree'); + -- cgit v1.2.3