downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Vordefinierte Konstanten> <Liste der Schlüsselworte
[edit] Last updated: Fri, 17 May 2013

view this page in

Vordefinierte Klassen

Dieser Abschnitt listet vordefierte Klassen auf, welche von PHP selbst definiert werden. Von Erweiterungen definierte Klassen werden in den jeweiligen Abschnitten des Manuals beschrieben.

Standardmäßig definierte Klassen

Diese Klassen sind im Standard-Funktionsumfang einer PHP-Distribution enthalten.

Directory
Die Klasse die von dir() instanziiert wird.
stdClass
Erstellt beim Casten zu einem Objekt.
__PHP_Incomplete_Class
Wird unter Umständen von unserialize() erstellt.

Vordefinierte Klassen in PHP 5

Diese zusätzlichen vordefinierten Klassen wurden mit PHP 5.0.0 eingeführt.

exception
php_user_filter

Closure

Die vordefinierte finale Klasse Closure wurde in PHP 5.3.0 eingeführt. Sie wird benutzt um anonyme Funktionen darzustellen.

Weitere Informationen siehe Beschreibung der Klasse.

Spezielle Klassen

Die folgenden Bezeichner können nicht als Klassenname genutzt werden, da sie eine besondere Bedeutung haben.

self
Aktuelle Klasse.
static
Aktuelle Klasse zur Laufzeit.
parent
Vaterklasse.


Vordefinierte Konstanten> <Liste der Schlüsselworte
[edit] Last updated: Fri, 17 May 2013
 
add a note add a note User Contributed Notes Vordefinierte Klassen - [4 notes]
up
1
Typer85 at gmail dot com
6 years ago
In response to the note below mine,

This list is not incomplete. Read the Manual folks, its listed there plain and simple:

"This section lists standard predefined classes. Miscellaneous extensions define other classes which are described in their reference."

Depending on what extensions you have, they might define their own classes. This list is just the standard classes as defined by PHP with no regards to extensions.
up
0
unknown
10 years ago
It's handy to have a array of the reserved classes.....
var_dump (get_declared_classes ());
up
0
spark at limao dot com dot br
1 year ago
if you want a Dynamic class you can extend from, add atributes AND methods on the fly you can use this:
<?php
   
class Dynamic extends stdClass{
        public function
__call($key,$params){
            if(!isset(
$this->{$key})) throw new Exception("Call to undefined method ".get_class($this)."::".$key."()");
           
$subject = $this->{$key};
           
call_user_func_array($subject,$params);
        }
    }
?>

this will accept both arrays, strings and Closures:
<?php
    $dynamic
->myMethod = "thatFunction";
   
$dynamic->hisMethod = array($instance,"aMethod");
   
$dynamic->newMethod = array(SomeClass,"staticMethod");
   
$dynamic->anotherMethod = function(){
        echo
"Hey there";
    };
?>

then call them away =D
up
0
Simon Kissane
8 years ago
The above list is incomplete. For example, on my PHP 5.0 configuration (yours may differ depending on the extensions you choose to install), the following classes are predefined:

== "Core" ==
stdClass
Exception
__PHP_Incomplete_Class
php_user_filter
Directory

== Reflection API ==
ReflectionException
Reflection
ReflectionFunction
ReflectionParameter
ReflectionMethod
ReflectionClass
ReflectionObject
ReflectionProperty
ReflectionExtension

== SQLLite ==
SQLiteDatabase
SQLiteResult
SQLiteUnbuffered
SQLiteException

== Standard PHP Lib. ==
RecursiveIteratorIterator
FilterIterator
ParentIterator
LimitIterator
CachingIterator
CachingRecursiveIterator
ArrayObject
ArrayIterator
DirectoryIterator
RecursiveDirectoryIterator

== SimpleXML ==
SimpleXMLElement
SimpleXMLIterator

== DOM/XSL/XPath extensions ==
DOMException
DOMStringList
DOMNameList
DOMImplementationList
DOMImplementationSource
DOMImplementation
DOMNode
DOMNameSpaceNode
DOMDocumentFragment
DOMDocument
DOMNodeList
DOMNamedNodeMap
DOMCharacterData
DOMAttr
DOMElement
DOMText
DOMComment
DOMTypeinfo
DOMUserDataHandler
DOMDomError
DOMErrorHandler
DOMLocator
DOMConfiguration
DOMCdataSection
DOMDocumentType
DOMNotation
DOMEntity
DOMEntityReference
DOMProcessingInstruction
DOMStringExtend
DOMXPath
XSLTProcessor

 
show source | credits | stats | sitemap | contact | advertising | mirror sites