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

search for in the

定義済みの定数> <キーワードのリスト
[edit] Last updated: Fri, 10 Feb 2012

view this page in

定義済のクラス

ここでは、標準で定義されているクラスをとりあげます。 さまざまな拡張モジュールで定義されるその他のクラスについては、 個々の拡張モジュールのリファレンスで述べられています。

標準で定義されているクラス

以下のクラスは、PHP ビルドに含まれる標準関数セットで定義されています。

Directory
dir() が作る。
stdClass
オブジェクトへの型変換 で作られる。
__PHP_Incomplete_Class

PHP 5 以降で定義済みのクラス

以下に PHP 5.0.0 で導入されたその他の定義済みのクラスを示します。

exception
php_user_filter

クロージャ

Closure が PHP 5.3.0 で追加されました。このクラスは定義済みの final クラスで、無名関数 を表すために用いられています。

詳細な情報は、Closure クラスのページ を参照ください。

特別なクラス

次の識別子は特別な意味を持っているので、クラス名としては使えません。

self
現在のクラス
static
実行時における現在のクラス
parent
親クラス


定義済みの定数> <キーワードのリスト
[edit] Last updated: Fri, 10 Feb 2012
 
add a note add a note User Contributed Notes 定義済のクラス
spark at limao dot com dot br 15-Aug-2011 02:21
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
Typer85 at gmail dot com 17-Feb-2007 08:58
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.
Simon Kissane 14-Sep-2004 12:54
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
unknown 23-Jul-2002 10:29
It's handy to have a array of the reserved classes.....
var_dump (get_declared_classes ());

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