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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:11:51+00:00 2026-05-24T07:11:51+00:00

we can simply override a default php function by using the following code :

  • 0

we can simply override a default php function by using the following code :

namespace blarg;
function time() {
  echo "test !";
}
time();

but ! is it possible to override the “eval” functon ?

namespace blarg;
function eval() {
echo "test !";
}
eval();

?

thanks in advance

According to the answeres :

  1. eval() is a language construct and not a function, we can’t override it
    2.Im not really overriding the time() function in my example. I’m just creating a blarg\time() function

I understood
BUT
Actually i’m writtin sumting like a debugger and i need to change the default behaviour of php functons or some language construct (e.g eval)
Is there anyway to do this ?
Is it possible to change the php source and compile it ? (Is there any specific file to edit ?)

  • 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-24T07:11:52+00:00Added an answer on May 24, 2026 at 7:11 am
    namespace blarg;
    function time() {
      echo "test !";
    }
    time();
    

    This does not override the builtin time() function. What this does is create the function blarg\time() — that is, both time() and blarg\time() exist and can be called, so never was time() overridden.

    When you call time() in the blarg namespace, both the builtin time() and local blarg\time() functions are candidates to be called; however, PHP will disambiguate by always calling the most local name, which in this case is blarg\time().

    Now, if we ask if it is possible to introduce a function locally named eval(), the answer is no, because eval is a reserved word in the PHP language because of its special meaning — referred to as a language construct. Other examples of the same nature are isset, empty, include, and require.

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

Sidebar

Related Questions

According to this site I can simply write $user = getlogin(); but the group
I hate generating an exception for things that I can simply test with an
In Python, how can I simply do the equivalent of dictionary.get(key, default) for lists
I know I should do my homework on my own but I simply can't
lilypond can color notes in a arbitrary way using \override NoteHead #'color = #red
How can I override TinyMCE's default formatting for basic stuff like bold, underline, and
I'm trying to make an applet which I can simply drag an image. And
When you declare a type parameter for the class, you can simply use that
Can you simply delete the directory from your python installation, or are there any
Can I simply use if(myString == nil) For some reason a string that I

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.