note 130360 added to language.oop5.autoload

From: Date: Tue, 10 Jun 2025 18:24:30 +0000
Subject: note 130360 added to language.oop5.autoload
Groups: php.notes 
Request: Send a blank email to php-notes+get-222214@lists.php.net to get a copy of this message
<?php namespace util; class Autocarga { public static function registraAutocarga(): void { spl_autoload_register([self::class, 'autocarga']); } public static function autocarga(string $clase): void { $archivo = __DIR__ . '/../'. str_replace('\\', '/', $clase). '.php'; if (file_exists($archivo)) { require_once $archivo; } else { echo "No existe el archivo $archivo"; } } } ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 94.73.34.245) ---- Manual Page -- https://php.net/manual/en/language.oop5.autoload.php Edit -- https://main.php.net/note/edit/130360 Del: integrated -- https://main.php.net/note/delete/130360/integrated Del: useless -- https://main.php.net/note/delete/130360/useless Del: bad code -- https://main.php.net/note/delete/130360/bad+code Del: spam -- https://main.php.net/note/delete/130360/spam Del: non-english -- https://main.php.net/note/delete/130360/non-english Del: in docs -- https://main.php.net/note/delete/130360/in+docs Del: other reasons-- https://main.php.net/note/delete/130360 Reject -- https://main.php.net/note/reject/130360 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222214) next »