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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:36:03+00:00 2026-05-12T22:36:03+00:00

Say I have file.php with three functions and an echo statement: function one() {

  • 0

Say I have file.php with three functions and an echo statement:

function one() {
    return three() . ' This is one.';
}

function two() {
    return 'This is two.';
}

function three() {
    return 'This is three.';
}

echo one(); // string(xx) "This is three. This is one."

First, is it generally acceptable to have function one() call function three() even though function three() appears later in the file?

Second, when file.php is loaded in the browser (thus executing the PHP on the server), does PHP calculate the return value of function two(), even though it is never called?

Any links for further reading on how PHP process mundane things like this would be great.

  • 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-12T22:36:04+00:00Added an answer on May 12, 2026 at 10:36 pm

    First, is it generally acceptable to
    have function one() call function
    three() even though function three()
    appears later in the file?

    Certainly. The source-order has no bearing on the order in which you call functions – it’s all parsed and available before the first line is executed.

    Second, when file.php is loaded in the
    browser, does PHP calculate the return
    value of function two(), even though
    it is never called?

    No. It will be checked for syntax errors during parsing, but that’s it – these will be E_PARSE level errors. Other errors are only discoverable at runtime and will be E_ERROR, E_WARNING, or E_NOTICE level errors.

    https://www.php.net/manual/en/errorfunc.constants.php

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

Sidebar

Ask A Question

Stats

  • Questions 225k
  • Answers 225k
  • 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 Is the newPage() method virtual? If so, you could subclass… May 13, 2026 at 12:58 am
  • Editorial Team
    Editorial Team added an answer I think as long as you're not using native modules… May 13, 2026 at 12:58 am
  • Editorial Team
    Editorial Team added an answer Try this XPath query instead: (/rss/channel/item)[position() <= 5] It returns… May 13, 2026 at 12:58 am

Related Questions

There are some posts about this matter, but I didn't clearly get when to
Questions Updated instead of making a new question... I really want to provide a
I have the code for a javascript calendar and it works perfectly as it
What is the best way to build a loopback URL for an AJAX call?
I just ran into something weird. I have two JSON arrays which holds different

Trending Tags

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

Top Members

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.