လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> spl_object_hash

spl_object_hash

သတ်မှတ်ထားသောအရာဝတ်ထု၏ hash ID ကိုပြန်ပို့သည်
အမည်:spl_object_hash
အမျိုးအစား:ခွက်အပိုင်း
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:အရာဝတ်ထု၏ hash တန်ဖိုးကိုရယူပါ

function name: spl_object_hash ()

သက်ဆိုင်သောဗားရှင်း: PHP 5> = 5.2.0, PHP 7

အသုံးပြုမှု - spl_object_hash () function ကိုအရာဝတ်ထုတစ်ခု၏ hash တန်ဖိုးကိုရရှိရန်အသုံးပြုသည်။

Syntax: string spl_object_hash (Object $ Obj)

Parametermer

  • $ OBJ: hash တန်ဖိုးကိုရရန်အရာဝတ်ထု။

ပြန်လာတန်ဖိုး - အရာဝတ်ထု၏ hash တန်ဖိုးကိုကိုယ်စားပြုသည့် string ကိုပြန်ပို့သည်။

ဥပမာ -

 class MyClass { public $name; } $obj1 = new MyClass(); $obj2 = new MyClass(); $obj1->name = "Object 1"; $obj2->name = "Object 2"; echo spl_object_hash($obj1); // 输出:000000005b4b0b8d000000001f3b3d8a echo spl_object_hash($obj2); // 输出:000000005b4b0b8d000000001f3b3d8b

ရှင်းလင်းချက် - အထက်ပါဥပမာတွင်ကျွန်ုပ်တို့သည် MyClass အမည်ရှိအတန်းကို သတ်မှတ်. Obj1 abb1 နှင့် $ obj2 ကိုဖန်တီးသည်။ ထို့နောက်အရာဝတ်ထုတစ်ခုစီ၏ပိုင်ဆိုင်မှုအမည်ကိုတန်ဖိုးရှိပြီး SPL_OBJOX_HASH () function ကိုအသုံးပြုသည်။

နောက်ဆုံးအနေဖြင့်ကျွန်ုပ်တို့သည် ECHO ကြေငြာချက်ကို $ obj1 နှင့် $ obj2 ၏ hash တန်ဖိုးများကိုထုတ်ယူရန်အသုံးပြုသည်။ ဇာတ်ညွှန်းလည်ပတ်တိုင်း hash တန်ဖိုးသည်ကွဲပြားနိုင်သည်ကိုသတိပြုပါ။

spl_object_Hash () function ကို အသုံးပြု. အရာဝတ်ထုတစ်ခုအတွက်ထူးခြားသောအမှတ်အသားတစ်ခုရရှိရန်အသုံးပြုနိုင်သည်။ ၎င်းသည်အရာဝတ်ထုသည်တူညီသောသို့မဟုတ် cache ခလုတ်ကိုအသုံးပြုသည်ဖြစ်စေနှိုင်းယှဉ်နိုင်သည်။

သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • သတ်မှတ်ထားသောအတန်းအစား၏မိဘအတန်းကိုပြန်လည်ရောက်ရှိ class_parents

    class_parents

    သတ်မှတ်ထားသောအတန်းအစ
  • သတ်မှတ်ထားသောအရာဝတ်ထု၏ hash ID ကိုပြန်ပို့သည် spl_object_hash

    spl_object_hash

    သတ်မှတ်ထားသောအရာဝတ်ထ
  • ပေးထားသောအရာဝတ်ထု၏ integer အရာဝတ်ထုလက်ကိုင်ပြန်ပို့ spl_object_id

    spl_object_id

    ပေးထားသောအရာဝတ်ထု၏in
  • spl_autoload function မှအသုံးပြုသော default file extension ကိုမှတ်ပုံတင်ပြီးပြန်ပို့ပါ spl_autoload_extensions

    spl_autoload_extensions

    spl_autoloadfunction
  • Eterator မှ iterator မှ etray မှကူးယူပါ iterator_to_array

    iterator_to_array

    Eteratorမှiteratorမှ
  • ITERATOR မှ Element တစ်ခုစီအတွက်အသုံးပြုသူသတ်မှတ်ထားသော function ကိုခေါ်ပါ iterator_apply

    iterator_apply

    ITERATORမှElementတစ်
  • ပေးထားသောအတန်းအစားအသုံးပြုသောစရိုက်များကိုပြန်ပို့သည် class_uses

    class_uses

    ပေးထားသောအတန်းအစားအသ
  • မှတ်ပုံတင်ထားသော __Autoload () function ကိုမှထွက်ပါ spl_autoload_unregister

    spl_autoload_unregister

    မှတ်ပုံတင်ထားသော__Au
လူကြိုက်များသော ဆောင်းပါးများ