get_resources

(PHP 7, PHP 8)

get_resourcesReturns active resources

Beschreibung

get_resources(?string $type = null): array

Returns an array of all currently active resources, optionally filtered by resource type.

Hinweis: This function is meant for debugging and testing purposes. It is not supposed to be used in production environments, especially not to access or even manipulate resources which are normally not accessible (e.g. the underlying stream resource of SplFileObject instances).

Parameter-Liste

type

If defined, this will cause get_resources() to only return resources of the given type. A list of resource types is available.

If the string Unknown is provided as the type, then only resources that are of an unknown type will be returned.

If omitted, all resources will be returned.

Rückgabewerte

Returns an array of currently active resources, indexed by resource number.

Changelog

Version Beschreibung
8.0.0 type is nullable now.

Beispiele

Beispiel #1 Unfiltered get_resources()

<?php
$fp 
tmpfile();
var_dump(get_resources());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

array(1) {
  [1]=>
  resource(1) of type (stream)
}

Beispiel #2 Filtered get_resources()

<?php
$fp 
tmpfile();
var_dump(get_resources('stream'));
var_dump(get_resources('curl'));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

array(1) {
  [1]=>
  resource(1) of type (stream)
}
array(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

Mitstreiter gesucht: On-Premise AI Analyzer (Symfony 8 + Ollama)

Hi Deep, thanks for your reply. Before arranging a call, I'd like to understand a little better what specifically interests you about the project ...

Geschrieben von schrobak am 17.09.2026 16:03:48
Forum: Jobangebote
Mitstreiter gesucht: On-Premise AI Analyzer (Symfony 8 + Ollama)

Hallo Stefan, ja, mein Vorname ist „Deep“; ich komme nicht aus München und spreche kein Deutsch. Ich bin ein Profi mit mehr als 17 Jahren Pro ...

Geschrieben von deepvyas am 17.09.2026 15:49:06
Forum: Jobangebote
A Closer Look at the Immortals Mission in MLB The Show 26: U4N Guide

The Vintage Program adds a nostalgic layer to MLB The Show 26 by bringing attention to players connected to the famous Immortals era of MLB The Sh ...

Geschrieben von ParkerBlair am 17.09.2026 11:01:38
Forum: HTML, JavaScript, AJAX, jQuery, CSS, Bootstrap, LESS
Aion 2 PvP Balance and U4N Choices

For many players, Aion 2 Kinah (https://www.u4n.com/aion-2/kinah) matters because currency can influence access to equipment and progression resou ...

Geschrieben von ParkerBlair am 17.09.2026 10:56:53
Forum: Fragen/Vorschläge zum Forum