use IterMethods; public static function hacklib_initialize_statics() { self::hacklib_initialize_statics_IterMethods(); } } Foo::hacklib_initialize_statics(); class Bar implements \HH\KeyedIterable, HH\Unrelated { use IterMethods; public static function hacklib_initialize_statics() { self::hacklib_initialize_statics_IterMethods(); } } Bar::hacklib_initialize_statics(); } namespace blah { class Baz implements \HH\KeyedIterable, \HH\Unrelated { use \IterMethods; public static function hacklib_initialize_statics() { self::hacklib_initialize_statics_IterMethods(); } } Baz::hacklib_initialize_statics(); testKeys(new \Foo()); testKeys(new \Bar()); testKeys(new Baz()); }
________________________________ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |___|___|___|___|___|___|___|___| E ); testKeys(55, <<<E ____________________________________________________________________________________________________________________________________________________________________________________________________________________________ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___| E ); // Premature exit with status code 1 if any test failed done(); // If it reaches this point then all the tests were successful echo "All the tests completed successfully.\n"; // The test suite completed; that's all for now. exit; } elseif ($argc == 2 && $argv[1] == 'source') { // If there is only one argument and it is 'source' then display the code // You can put the output into a file or run it directly by piping it to php: // $ php recursive-ascii-spirals.php source | php -d error_reporting=0 4 r c 3