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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:31:08+00:00 2026-05-13T07:31:08+00:00

What are some of the most expensive operations in PHP? I know things like

  • 0

What are some of the most expensive operations in PHP? I know things like overusing the @ operator can be expensive. What else would you consider?

  • 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-13T07:31:08+00:00Added an answer on May 13, 2026 at 7:31 am
    • serialize() is slow, as is eval(), create_function(), and spawning additional processes via system() and related functions.
    • beware of anything APC can’t cache — conditional includes, eval()ed code, etc.
    • Opening database connections. Always cache your connections and re-use them.
    • Object cloning
    • Regular expressions. Always use the normal string operations over a regular expression operation if you don’t need the functionality of a regexp, e.g. use str_replace() over preg_replace() where possible.
    • Logging and disk writes can be slow – eliminate unnecessary logging and file operations

    Some micro-optimizations that are good practice, but won’t make much difference to your bottom line performance:

    • Using echo is faster than print
    • Concatenating variables is faster than using them inline in a double-quoted string.
    • Using echo with a list of arguments is faster than concatenating the arguments. Example: echo 'How are you ',$name,' I am fine ',$var1 is faster than echo 'How are you '.$name.' I am fine '.$var1
    • Develop with Notices and Warnings turned on. Making sure they don’t get triggered saves PHP from having to run error control on them.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a menu that contains, among other things, some most-recently-used file paths. The
What would anyone consider the most efficient way to merge two datasets using Python?
I'm profiling some C# code. The method below is one of the most expensive
some (most) of opencv errors are discovered in run time - using CV_64 instead
I have a stored procedure that is returning a few fields, most containing some
Most program languages have some kind of exception handling; some languages have return codes,
Most databases support some form of insert into select... statement. insert into a select
Most projects now need some form of a database. When someone says database, I
For some reason I have always assumed that most of the time a variable
Most of you certainly use some kind of bugtracker. Maybe internally only, once a

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.