Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 552101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:27:50+00:00 2026-05-13T11:27:50+00:00

I just realized the professor Google is unable to present a specific page where

  • 0

I just realized the professor Google is unable to present a specific page where I can find out, when static keyword added to PHP 4. Though following the change log for php 4 I can see that it was available since Version 4.0.6 (or before) but why does it throws:

Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in {FILE_PATH+LINE#}

for a simple code as follows:

class myClass
{
    static $_debug = true;
}

Or this assignment of class-variable was introduced in earlier versions of PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:27:50+00:00Added an answer on May 13, 2026 at 11:27 am

    I’m pretty sure static class variables are new to PHP5, so can’t be used in PHP4.

    Here’s the deal: PHP4 can use the static keyword in functions, not classes. The only PHP4 usage of static was like this:

    function howManyTimes() {
        static $count = 0;
        echo "Function has been called $count times.";
        $count++;
    }
    

    That variable is bound to the function’s scope forever. That’s how PHP4 interprets static. The PHP5 interpretation you are trying to use is not available in your current PHP version. Sorry!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just realized that the .erb extension can be added to .js files (what
I just realized how useful the little on -function can be. Ex: orderByLength =
I just realized that I've been using std::vector::data() out of similarity with std::string, but
I just realized I can add an event handler in two ways: Consider an
I just realized static events exist - and I'm curious how people use them.
I just realized for my cocoa application I can set the garbage collector setting
I just realized that you can't just use an if statement on a function,
I just realized that I left out a file that I was supposed to
I just realized a problem with the (single-threaded) Node.js: The server begins responding to
Just realized that the delegates I am declaring are not declared with pointer type.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.