SplFileInfo::setInfoClass

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::setInfoClassSets the class used with SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo()

Beschreibung

public SplFileInfo::setInfoClass(string $class = SplFileInfo::class): void

Use this method to set a custom class which will be used when SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() are called. The class name passed to this method must be SplFileInfo or a class derived from SplFileInfo.

Parameter-Liste

class

The class name to use when SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() are called.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 SplFileInfo::setFileClass() example

<?php
// Define a class which extends SplFileInfo
class MyFoo extends SplFileInfo {}

$info = new SplFileInfo('foo');
// Set the class name to use
$info->setInfoClass('MyFoo');
var_dump($info->getFileInfo());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

object(MyFoo)#2 (0) { } 

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

How do I properly close my FAB account?

Hi all, I’ve been trying to figure out the process for closing my FAB account here in the UAE. I don’t use it much anymore, and I want to mak ...

Geschrieben von doortat am 26.03.2026 19:12:13
Forum: HTML, JavaScript, AJAX, jQuery, CSS, Bootstrap, LESS
Where are the code snippets?

They’re not gone. You just need to be logged in to see the code snippets. Once you sign in, they show up normally.

Geschrieben von doortat am 26.03.2026 19:07:58
Forum: Fragen/Vorschläge zum Forum
XML Formatierungs Problem

Ich habe es jetzt mit verschiedenen Quellcode ausprobiert. Zb. https://codelucky.com/php-dom/ Ich habe immer das Problem sobald ich ein neuer Elem ...

Geschrieben von JanG am 26.03.2026 18:59:00
Forum: XML
[Freelancer] Web development: programming and design

I’ve been going through your portfolio and it’s really impressive how you handle custom web development across different platforms and program ...

Geschrieben von Kristee am 26.03.2026 12:57:09
Forum: Archiv / Trash