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

  • GUN-TIME with Brandon

    GUN-TIME wit

    3 ŞUBAT 2009
  • ipsy

    ipsy

    1 EKİM 2012
  • Crossover

    Crossover

    18 HAZİRAN 2007