New Premium Tutorial: All About the “Static” Keyword
plusvideos

New Premium Tutorial: All About the “Static” Keyword

Tutorial Details
  • Topic: The "Static Keyword"
  • Tutorial Format: Article and Video
  • Estimated Difficulty: Intermediate
Download Source Files

Today, we are going to learn how to use the ’static’ keyword in PHP. We are going go over the basics and build some examples. It is time to add this interesting language feature to your web development bag of tricks. Become a Premium member today to see this and many other tutorials!


Join Net Premium

NETTUTS+ Screencasts and Bonus Tutorials

For those unfamiliar, the family of TUTS sites runs a premium membership service. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from Nettuts+, Psdtuts+, Aetuts+, Audiotuts+, and Vectortuts+! For the price of a pizza, you’ll learn from some of the best minds in the business. Become a Premium member!

Add Comment

Discussion 17 Comments

  1. Marcin says:

    It happens again – a premium tutorial which is seriously less thorough than a huge number of free tutorials available here. It is somewhat useful, but still, it leaves an impression of a piece written in a hurry, just to fill the premium section with any content whatsoever, justifying the monthly fee.

    • Burak says:
      Author

      There was some talk about expanding the Premium section. I believe there will be some improvements coming.

      Also, the monthly fee costs less than a movie ticket, which is way more than justified in my opinion.

      • Marcin says:

        Thanks for commenting. I really love your articles in the free section, for example the entire CI series, the MySQL-related articles, etc. I think you will agree that they are generally more detailed than the last one in the premium section :-).

        I am paying for the premium section mainly as a way to express my support for the quality of the free section, not so much because of what’s inside the premium section. There’s the argument that for USD 9 I get access to all premium content, but well, I’m really into web dev and other sites are of little interest to me, maybe except for psd tuts occassionally.

      • Scott says:

        @Burak, Not if you can find the same thing for free anyways….

  2. Latavish says:

    And for the newbies and beginners he means…
    http://php.net/manual/en/language.oop5.static.php

  3. Jaimie van Santen says:

    Article and video. Wheres the video? The link only contains a zip file.

  4. Interesting. Ive being contemplating going premium for a while. Still not completely sold yet ;)

  5. A tut’ on static variables isn’t going to make anyone sign up to be fair. There are a lot of free resources that demonstrate and explain static variables very well. Unless there’s some kind of hook a very clever use you’ve used Burak.

    As people have said, you’re part in the CI series was brilliant, there are free resources out there for CI but your tut’s tower above the rest and delve into many different aspects of CI in one tutorial.

  6. flashmac says:

    I’d have to agree on previous comments that there are more extensive free tuts than this premium tut, however, this tut focuses on the static keyword and lets be honest, how extensive can you be?

    The tut provides good examples of all cases, and although I ‘thought’ I knew exactly how I to utalise the static keyword both in functions and classes, I still took something away from the very last example.

    For beginners, especially those starting to build classes for the first time, this might merit a premium tut (albeit a short one).

    Good job Burak.

  7. Paul says:

    Hey Burak,

    can you do a followup on other oop concenpts in php like how the objects interact with each other and how you would work with abstract classes and more advanced concepts?

    -Paul

  8. ShadowAssassin says:

    *sigh*, is this the best premium tutorial you guys get submitted here? This (I am not premium member), is pretty weak in my opinion, its not hard to use static:

    public static function helloWorld() {

    echo “Hello World!”;

    }

    myclass::helloWorld();

    You even provided the php.net links, I think they are extensive enough.

    We need something great for premium, I feel as if Net.tuts is not producing the best anymore, recently, there has been loads of articles about codecanyon items – what is the use?

    I don’t want to nag, but I love reading tutorials, and there have been better free/premium (CI series – should of been premium) tutorials on here.

    Anyway, lets hope we get some better tutorials on Net.tuts :)

    • commenter says:

      I’m sure this tutorial evolves on what statics are, static methods have a large place in OOP programming, and have many uses

  9. james anelay says:

    If you try to login on this page, it finds a 404, due to the “‘s in the url me thinks. Just letting you know.

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.