Use the static modifier to change a member or method : static properties « Class « PHP






Use the static modifier to change a member or method

 
<?php
class myclass {
  const MYCONST = 123;
  static $value = 567;
}

echo 'myclass::MYCONST = ' . myclass::MYCONST . "\n";
echo 'myclass::$value = ' . myclass::$value . "\n";
?>
  
  








Related examples in the same category

1.static class properties
2.static class members
3.Using the -> and :: operators to call hypnotize
4.Using Static Methods and Properties to Limit Instances of a Class (PHP 5 Only)