Static Methods/Properties

You can specify methods & properties as static that permits access to them from outside of the class.

<?php
class foo {
    public static $bar = 123;
    
    public static function baz() {
        return 456;
    }
}

echo foo::$bar; // will print 123
echo foo::baz(); // will print 456
?>

Loading ...

Related Results :

  1. Static Methods/Properties
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author