3v4l.org

run code in 300+ PHP versions simultaneously
<?php function autoloadGoogleApi($className) { $classPath = explode('_', $className); if ($classPath[0] != 'Google') { return; } // Drop 'Google', and maximum class file path depth in this project is 3. $classPath = array_slice($classPath, 1, 2); $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php'; if (file_exists($filePath)) { require_once($filePath); } } spl_autoload_register('autoloadGoogleApi');

preferences:
18.11 ms | 409 KiB | 5 Q