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

search for in the

ストリーム> <SplBool
[edit] Last updated: Fri, 07 Jun 2013

view this page in

SplString クラス

(PECL spl_types >= 0.1.0)

導入

SplString クラスは、文字列型をより強力に型付けするために使用します。

クラス概要

SplString extends SplType {
/* 定数 */
const integer __default = 0 ;
/* 継承したメソッド */
SplType::__construct ([ mixed $initial_value [, bool $strict ]] )
}

定義済み定数

SplString::__default

例1 SplString の使用例

<?php
$string 
= new SplString("Testing");

try {
    
$string = array();
} catch (
UnexpectedValueException $uve) {
    echo 
$uve->getMessage() . PHP_EOL;
}

var_dump($string);
echo 
$string// 出力は "Testing"
?>

上の例の出力は以下となります。

Value not a string
object(SplString)#1 (1) {
  ["__default"]=>
  string(7) "Testing"
}
Testing



add a note add a note User Contributed Notes SplString - [0 notes]
There are no user contributed notes for this page.

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