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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:11:08+00:00 2026-05-17T23:11:08+00:00

A very minor saving either way but it prompted a mini-debate in the office

  • 0

A very minor saving either way but it prompted a mini-debate in the office and I wanted to get other feedback on it.

Assuming integer values for $x which is more efficient;

($x >= 3) 

or

($x > 2)

edit

I have rolled back a wording change because one of the factors we discussed is that some believed >= to be easier to immediately read and felt that for int values > 2 was pointless because you meant >= 3. This does not make the script faster but potentially more efficient in terms of maintaining it. (in before people explain how tiny a point this is)

  • 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-17T23:11:09+00:00Added an answer on May 17, 2026 at 11:11 pm

    On my test machine (PHP 5.3.3) I ran 5 runs of 10 million iterations of each and averaged the results. “$x > 2” took 5.7357 seconds while “$x >= 3” took 5.8654. Note this excludes compilation time because compilation occurred only once for these iterations. So “$x > 2” is faster, but barely. I don’t understand why, but there you go.

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

Sidebar

Related Questions

I suspect this is a very minor issue, but I have spent several hours
I just tried to rebase a very old branch with a minor modification onto
Very noob question, I know, but I didn't manage to handle real-time slider move
Very new to C++ and Cocos2d-x but I was just toying around with CCArray
Very new to javascript and html-type stuff. I wanted to just make a quick
After a very standard and minor release, our Apache/Nginx/Django/wsgi setup ceased to function with
very simple problem, but i want to see how experts look at it. This
I'm following the List View tutorial and I have this code (very minor modifications):
I'm writing a very simple text editor and have run into a somewhat minor
I've came across strange issue. I know I'm missing something very minor. Can Any

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.