Files
php_8/namespace/anonim.php

12 lines
386 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
spl_autoload_register(function(string $classname){
$namespace = array_map(
fn($class) => $class != 'PHP8' ? strtolower($class) : $class,
explode('\\', $classname)
);
require_once(__DIR__ . '/' . implode('/', $namespace) . '.php');
});
$page = new PHP8\Page('О нас', 'Содержимое страницы');
$page->authors(); // Author::authors()