« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 4 of about 4 for CustomDateTimeImmutable (0.002 sec.)
DateTime をシリアライズする 11095
« DateTimeInterface::getTimezone DateTime::__unserialize » PHP Manual DateTimeInterface DateTime をシリアライズする 検索 DateTime::__serialize DateTimeImmutable::__serialize DateTimeInterface::__serialize (PHP 8 >= 8.2.0) DateTime::__serial ... にはパラメータはありません。 戻り値 DateTime の シリアライズ表現を返します。 例 例1 DateTime::__serialize() の例 <?php class CustomDateTimeImmutable extends DateTimeImmutable { #[ \Override ] public function __serialize (): array { return [ 'date' => $this -> format ( Da ... getTimestamp (), 'timezone' => $this -> getTimeZone ()-> getName (), 'to' => 'Drink a cup of coffee' , ]; } } $date = new CustomDateTimeImmutable ( '2025-03-27' ); var_dump ( serialize ( $date )); 上の例の出力は以下となります。 string(171) "O:23:"CustomDateTimeImmutab ... イズする 関連キーワード: serialize DateTime DateTimeInterface シリアライズ DateTimeImmutable function array date unserialize CustomDateTimeImmutable パラメータ timestamp timezone Drink cup coffee アンシリアライズ getTimezone Search handler ...
https://man.mtool.work/php/8.3/datetime.serialize.html
DateTime をシリアライズする 11095
« DateTimeInterface::getTimezone DateTime::__unserialize » PHP Manual DateTimeInterface DateTime をシリアライズする 検索 DateTime::__serialize DateTimeImmutable::__serialize DateTimeInterface::__serialize (PHP 8 >= 8.2.0) DateTime::__serial ... にはパラメータはありません。 戻り値 DateTime の シリアライズ表現を返します。 例 例1 DateTime::__serialize() の例 <?php class CustomDateTimeImmutable extends DateTimeImmutable { #[ \Override ] public function __serialize (): array { return [ 'date' => $this -> format ( Da ... getTimestamp (), 'timezone' => $this -> getTimeZone ()-> getName (), 'to' => 'Drink a cup of coffee' , ]; } } $date = new CustomDateTimeImmutable ( '2025-03-27' ); var_dump ( serialize ( $date )); 上の例の出力は以下となります。 string(171) "O:23:"CustomDateTimeImmutab ... をアンシリアライズする 関連キーワード: serialize DateTime DateTimeInterface シリアライズ DateTimeImmutable date unserialize CustomDateTimeImmutable timestamp timezone Drink coffee アンシリアライズ getTimezone handler 表現 extends Override return format getTimestamp getT ...
https://man.mtool.work/php/8.3/datetime.serialize.html
Datetime をアンシリアライズする 7397
« DateTime::__serialize DateTime::__wakeup » PHP Manual DateTimeInterface Datetime をアンシリアライズする 検索 DateTime::__unserialize DateTimeImmutable::__unserialize DateTimeInterface::__unserialize (PHP 8 >= 8.2.0) DateTime::__unserializ ... です。 パラメータ data シリアライズされた DateTime 戻り値 値を返しません。 例 例1 DateTime::__unserialize() の例 <?php class CustomDateTimeImmutable extends DateTimeImmutable { #[ \Override ] public function __unserialize (array $data ): void { echo "Time to ` { $data [ ... :\n\n" ; parent :: __construct ( $data [ 'date' ], new DateTimeZone ( $data [ 'timezone' ])); } } $serializedData = 'O:23:"CustomDateTimeImmutable":4:{s:4:"date";s:25:"2025-03-27T00:00:00+00:00";s:9:"timestamp";i:1743033600;s:8:"timezone";s:3:"UTC";s:2:"to";s:21:"Drink ... ";}' ; var_dump ( unserialize ( $serializedData )); 上の例の出力は以下となります。 Time to `Drink a cup of coffee`: object(CustomDateTimeImmutable)#1 (3) { ["date"]=> string(26) "2025-03-27 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ...
https://man.mtool.work/php/8.3/datetime.unserialize.html
Datetime をアンシリアライズする 7397
« DateTime::__serialize DateTime::__wakeup » PHP Manual DateTimeInterface Datetime をアンシリアライズする 検索 DateTime::__unserialize DateTimeImmutable::__unserialize DateTimeInterface::__unserialize (PHP 8 >= 8.2.0) DateTime::__unserializ ... です。 パラメータ data シリアライズされた DateTime 戻り値 値を返しません。 例 例1 DateTime::__unserialize() の例 <?php class CustomDateTimeImmutable extends DateTimeImmutable { #[ \Override ] public function __unserialize (array $data ): void { echo "Time to ` { $data [ ... :\n\n" ; parent :: __construct ( $data [ 'date' ], new DateTimeZone ( $data [ 'timezone' ])); } } $serializedData = 'O:23:"CustomDateTimeImmutable":4:{s:4:"date";s:25:"2025-03-27T00:00:00+00:00";s:9:"timestamp";i:1743033600;s:8:"timezone";s:3:"UTC";s:2:"to";s:21:"Drink ... ";}' ; var_dump ( unserialize ( $serializedData )); 上の例の出力は以下となります。 Time to `Drink a cup of coffee`: object(CustomDateTimeImmutable)#1 (3) { ["date"]=> string(26) "2025-03-27 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ...
https://man.mtool.work/php/8.3/datetime.unserialize.html
PREV 1 NEXT