Using the -> and :: operators to call hypnotize : static properties « Class « PHP






Using the -> and :: operators to call hypnotize

 
<?php
    class Cat {
    }

class MyCat extends Cat {
    function MyCat(  ) {
    }
    public static function hypnotize(  ) {
      echo ("The cat was hypnotized.");
      return;
    }
}

MyCat::hypnotize(  );

$h_cat = new MyCat(  );
$h_cat->hypnotize(  );
  
  








Related examples in the same category

1.static class properties
2.static class members
3.Using Static Methods and Properties to Limit Instances of a Class (PHP 5 Only)
4.Use the static modifier to change a member or method