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

  • Home
  • SEARCH
  • 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 6010483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:07:21+00:00 2026-05-23T02:07:21+00:00

Is it possible to pool data or functionality in PHP? The amateur-ish PHP code

  • 0

Is it possible to pool data or functionality in PHP?

The amateur-ish PHP code that I write wakes up to handle a response, loads functions, opens database connections, create objects, initialises them, and then – dies after 0.01 secs when the response has been processed, leaving the next request to reload, parse, and run mainly the same thing again.

That’s non-sensical, and I find it removes the value of a lot of my work not to have functionality/data/object pooling. For example I can write classes, to find they all get reinitialised with each request – what’s the point of me trying to develop a meaningful object structure?

And so: how can I write PHP to pool data and functionality?

  • 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-23T02:07:22+00:00Added an answer on May 23, 2026 at 2:07 am

    There is no 1 solution pooling or persistent state in PHP, it hasn’t got an application state like Java, it more or less follows the stateless protocol that is HTTP. What you can do is:

    • Create persistent connections to databases (i.e. they will be reused if you call them with the same parameters, they won’t magically exist but you can avoid the overhead of an actual connect).
    • Store objects in sessions to keep a calculated state (they will be serialized, and unserialized on the next request).
    • Route work that requires significant, but one-time, initialization to a daemon running independent from the webserver (a gearman server & workers come to mind).
    • But in the end, if you application needs a global state, maybe PHP just isn’t the right solution.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to clear the pool of the current processes' UnsafeAuthenticatedConnectionSharing pool, i.e.
Is it possible to change the Passenger application pool size at runtime? Ie, without
Possible Duplicate: Program received signal: 0. Data Formatters temporarily unavailable I am taking above
In my project Spring manages connection pool with org.apache.commons.dbcp.BasicDataSource class. Is possible to get
Is it possible to create a pool of Message Listeners or a Message Driven
Is it possible to create a thread pool using boost's thread? i was looking
Is it possible to set up programmatic what application pool to use in my
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be

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.