SORU
18 EKİM 2010, PAZARTESİ


Kolon ve ok çift operatörler arasında fark PHP?

Php web kılavuzu Kenar Çubuğu, link text addChild yöntemi :: kapsam çözümleme operatörünü kullanır, ama bu örnekte Ok operatörünü kullanır. Herkes neden bana söyleyebilir misiniz?

CEVAP
18 EKİM 2010, PAZARTESİ


:: -> örneğin elemanları ise statik öğeler için.

Örneğin:

class Example {
  public static function hello(){
    echo 'hello';
  }
  public function world(){
    echo 'world';
  }
}

// Static method, can be called from the class name
Example::hello();

// Instance method, can only be called from an instance of the class
$obj = new Example();
$obj->world();

More about the static concept

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:
Php

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • AyfionGaming

    AyfionGaming

    20 ŞUBAT 2013
  • backyardjay

    backyardjay

    8 ŞUBAT 2009
  • BiGSH0TROB

    BiGSH0TROB

    7 NİSAN 2011