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

search for in the

SplFloat> <SplType::__construct
[edit] Last updated: Fri, 25 May 2012

view this page in

SplInt クラス

(バージョン情報なし。おそらく SVN 版にしか存在しないでしょう)

導入

SplInt クラスは integer 型をより強力に型付けするために使用します。

クラス概要

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

定義済み定数

SplInt::__default

例1 SplInt の使用例

<?php
$int 
= new SplInt(94);

try {
    
$int '試しに文字列をキャストしてみましょう';
} catch (
UnexpectedValueException $uve) {
    echo 
$uve->getMessage() . PHP_EOL;
}

echo 
$int PHP_EOL;
?>

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

Value not an integer
94



add a note add a note User Contributed Notes SplInt
There are no user contributed notes for this page.

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