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 636755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:32:58+00:00 2026-05-13T20:32:58+00:00

I would like to know about static (class) field representation within PHP interpreter. For

  • 0

I would like to know about static (class) field representation within PHP interpreter.

For example, when you load a class in Java, static fields will be associated with that Class object; that means two applications running same JVM (and same classloader) will have some kind of shared global variable 😉

I’m just wondering, if I use some kind of PHP accelerator/opcode caching, what is that really cached? Is it just compiled bytecode, or a piece of VM state (responsible for storing class objects)?

It’s because I’m afraid of static fields/singleton objects sharing between requests, etc.

P.S.: I’m really a PHP newbie, so I’m very sorry if the question is way too dumb 🙂

  • 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-13T20:32:59+00:00Added an answer on May 13, 2026 at 8:32 pm

    An opcode cache will not change anything : each PHP script is executed by its own process (or thread), in isolation from the others.

    An opcode cache will only cache opcodes (the PHP equivalent of JAVA’s bytecode), and will nor store not related to the current execution of the script — i.e. not any kind of “VM state“.

    This means your static variables will exist in one version for each execution of your PHP script, even if that script is executed several times in parallel ; and using or not an opcode cache will not change a thing.

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

Sidebar

Ask A Question

Stats

  • Questions 488k
  • Answers 488k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer select a.col1, b.col1, coalesce(c.col1,0) from a inner join b on… May 16, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer You can use split and a list comprehension: l =… May 16, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer So you just want to remove the rows from the… May 16, 2026 at 8:43 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Would like to know from all you guys what do you think about my
I have about 30 different flagged enums that I would like to put into
I have this Python code that I found online and would like to know
Here's a really simple class: static public class Bean1 { final private String name;
I would like to ensure that a method (actually a constructor in my case)
I've been reading that the static methods of the File Class are better used
Ever since I found out about auto properties, I try to use them everywhere.
I am wondering how you would approach this problem I have two Taxrates that
I know that, in Delphi, instance variables and global variables are initialized to zero
First, I am not talking about the new 'dynamic' keyword n C# 4.0. :)

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.