/** * Defer a method to native PHP. * * @param string $class The class * @param string $method The method * * @return string The correct function to call */ public static function toNative($class, $method) { // Aliased native function $native = Method::getNative($method); if ($native) { return $native; } // Transform class to php function prefix switch ($class) { case static::TYPES . 'Arrays': $prefix = 'array_'; break; case static::TYPES . 'Strings': $prefix = 'str_'; break; } // If no function prefix found, return false if (!isset($prefix)) { return false; } // Native function $function = $prefix . $method; if (function_exists($function)) { return $function; } return false; }