タグ

ブックマーク / www.php.net (17)

  • PHP: DateInterval::__construct - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    WhatAmILookingFor
    WhatAmILookingFor 2016/07/12
    "いくつか簡単な例を示しましょう。 P2D は 2 日、 PT2S は 2 秒、そして P6YT5M は 6 年と 5 分を表します。"
  • PHP: TypeError - Manual

    Introduction A TypeError may be thrown when: The value being set for a class property does not match the property's corresponding declared type. The argument type being passed to a function does not match its corresponding declared parameter type. A value being returned from a function does not match the declared function return type.

    WhatAmILookingFor
    WhatAmILookingFor 2016/06/28
    TypeErroの発生3パターン
  • PHP: リファレンスカウントの原理 - Manual

    リファレンスカウントの原理 PHP 変数は「zval」と呼ばれるコンテナに保管されます。 zval コンテナには、変数の型と値の他に、情報の追加ビットを2つ含みます。 1つ目は「is_ref」と呼ばれ、変数が「参照集合」の一部かどうかを示すブール値 です。 このビットによって、通常の変数と参照を区別する方法を PHP エンジンが知ります。 &演算子によって作成されるように、PHP ではユーザーランドで参照を使えるので、 zval コンテナもメモリー使用状況を最適化するための内部的なリファレンスカウント機構を 持ちます。 追加情報の2つ目は「refcount」と呼ばれ、この1つの zval コンテナをどれだけ多くの 変数名(シンボルとも呼ばれます)が指すかを含みます。 シンボルは全てシンボルテーブルに保管され、スコープごとにシンボルテーブルの 1つがあります。 関数やメソッドごとのスコープば

  • PHP: パスワードのハッシュ - Manual

    I feel like I should comment some of the clams being posted as replies here. For starters, speed IS an issue with MD5 in particular and also SHA1. I've written my own MD5 bruteforce application just for the fun of it, and using only my CPU I can easily check a hash against about 200mill. hash per second. The main reason for this speed is that you for most attempts can bypass 19 out of 64 steps in

    PHP: パスワードのハッシュ - Manual
  • PHP: インストールにあたっての一般的な注意事項 - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    PHP: インストールにあたっての一般的な注意事項 - Manual
  • PHP: mysqli 拡張モジュールでの持続的接続 - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

  • PHP: 新機能 - Manual

    スカラー型宣言 スカラー 型宣言 には二つの方式があります。デフォルトの自動変換(coercive) モードと、 厳密に判断する strict モードです。 パラメータとして、 文字列 (string)、整数 (int)、浮動小数点数 (float)、boolean (bool) といった型をいずれかの方式で強制できるようになりました。 これらは、PHP 5 で導入された型宣言 (クラス名やインターフェイス、配列そして callable) を強化するものです。 <?php // デフォルトのモード function sumOfInts(int ...$ints) { return array_sum($ints); } var_dump(sumOfInts(2, '3', 4.1));

    PHP: 新機能 - Manual
  • PHP: 下位互換性のない変更点 - Manual

    エラーや例外の取り扱いの変更 fatal error や recoverable fatal error の多くが、PHP 7 では例外に変換されるようになりました。 これらの例外は Error クラスを継承したもので、 このクラスは Throwable インターフェイスを実装しています。 この新しいインターフェイスを、すべての例外が実装しています。 エラーではなく例外がスローされるようになるということは、自作のエラーハンドラは呼び出されなくなるということです (Error 例外をキャッチしなかった場合は、fatal エラーが発生します)。 PHP 7 におけるエラーハンドリングの詳細な説明は PHP 7 のエラー を参照ください。 この移行ガイドでは、下位互換性のない変更点を列挙するだけにとどめます。 set_exception_handler() が常に Exception オブジェク

    PHP: 下位互換性のない変更点 - Manual
  • PHP: 遅延静的束縛 (Late Static Bindings) - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

  • PHP: タイプヒンティング - Manual

    People often ask about scalar/basic typehints.  Here is a drop in class that I use in my MVC framework that will enable typehints through the use of a custom error handler. Note: You should include this code above all other code in your include headers and if you are the using set_error_handler() function you should be aware that this uses it as well.  You may need to chain your set_error_handlers

  • PHP: filter_var - Manual

    パラメータ value フィルタリングする値。値をフィルタリングする前に、 内部的に 文字列への変換 が行われることに注意しましょう。 filter 適用するフィルタの ID。フィルタの型 に、利用できるフィルタの一覧があります。 省略した場合は FILTER_DEFAULT を使います。これは FILTER_UNSAFE_RAW と同等です。 結果的に、デフォルトでは何もフィルタリングをしません。 options オプションあるいはフラグの論理和の連想配列。 オプションを指定可能なフィルタの場合、この配列の "flags" フィールドにフラグを指定します。 "callback" フィルタの場合は、callable 型を渡さなければなりません。 コールバックは、フィルタリングする値を引数として受け取り、 処理後の値を返すようにしなければなりません。 <?php // オプションを許可するフ

  • PHP: Memcache::set - Manual

    Memcache::set() は、キー key に var という値を 関連付け、memcached サーバーに格納します。パラメータ expire は、データの有効期限を秒単位で指定します。もし 0 を指定した場合は その項目が期限切れになることはありません (これは、その項目のデータが memcached サーバー上にずっと残り続けることを保証するものではありません。 他の項目をキャッシュするための場所を確保するためにサーバーから 削除されてしまうこともあります)。 (zlib を使用して) その場でのデータの圧縮を行いたい場合は、 flag の値として、定数 MEMCACHE_COMPRESSED を指定します。 注意: リソース型の変数 (たとえばファイル記述子や接続記述子など) はキャッシュに保存できないことを覚えておきましょう。これは、 シリアライズした状態ではそれらのデータ

    WhatAmILookingFor
    WhatAmILookingFor 2014/08/25
    memcachedにexipireを指定してキャッシュを保存するときに有効期限の指定は30日までという制限があるの知らなかった
  • PHP: コア php.ini ディレクティブに関する説明 - Manual

    以下に設定ディレクティブに関する 簡単な説明を示します。 short_open_tag bool PHP タグの短縮型 (<? ?>) を使用 可能にするかどうかを設定します。PHPをXMLと組み合わせて用いる 場合は、<?xml ?>をファイル中で用 いるためにこのオプションをオフにする必要があります。オンにし た場合にPHPでXMLを出力するには、例えば、次のようにします。 <?php echo '<?xml version="1.0"?>'; ?> これをオフにした場合、長い方の形式のタグ (<?php ?>)を使用する必要があります。 注意: これは、<?= 記法に影響を与えません。常に有効となります。 precision int 浮動小数点数に関して表示される最大桁数を指定します。 -1 は、数値を丸める際に拡張アルゴリズムを用いることを意味します。 serialize_prec

    PHP: コア php.ini ディレクティブに関する説明 - Manual
  • PHP: array_count_values - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    WhatAmILookingFor
    WhatAmILookingFor 2012/09/06
    配列の要素ごとに数を数えられるので地味に便利
  • PHP: APC - Manual

    Alternative PHP Cache はじめにインストール/設定要件インストール手順実行時設定リソース型定義済み定数APC 関数apc_add — 新規の変数をデータ領域にキャッシュするapc_bin_dump — 指定したファイルおよびユーザー変数のバイナリダンプを取得するapc_bin_dumpfile — キャッシュされたファイルやユーザー変数のバイナリダンプをファイルに出力するapc_bin_load — バイナリダンプを APC のファイル/ユーザーキャッシュに読み込むapc_bin_loadfile — バイナリダンプをファイルから APC のファイル/ユーザーキャッシュに読み込むapc_cache_info — APC のデータから、キャッシュされた情報を取得するapc_cas — 古い値を新しい値に更新するapc_clear_cache — APC キャッシュをクリア

  • PHP: 関数の引数 - Manual : 可変長引数リスト

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    PHP: 関数の引数 - Manual : 可変長引数リスト
    WhatAmILookingFor
    WhatAmILookingFor 2012/05/22
    引数の評価は、左から右の順番で行われます。
  • PHP: 無名関数 - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

  • 1