Answer the question
In order to leave comments, you need to log in
CPP inserts in PHP scripts
A friend is looking for a job, went for an interview naturally. So, in one of the web desks, one of the interlocutors told him that in PHP scripts you can insert c ++ code :) Now it doesn’t fit in my head how in an interpreted language there can be inserts of a compiled one. Maybe I'm outdated, and something has already come up with the same?
Answer the question
In order to leave comments, you need to log in
perhaps this question was asked to your friend to see how he would defend his point of view. If the candidate does not adequately argue, then it will be difficult for his boss ... Well, other options are probably either extension or hiphop-php.
Nobody mentioned hiphop-php . This is a little different, but considering that we have a deaf phone here (the interlocutor said to your friend, friend to you, you to us), it is quite possible that he meant it.
Maybe one of the interviewees did not master anything himself and meant exec?
Yes, it's easy - insert echo "<code>" and the user sees it :D
But seriously, inserting code written in c ++ is possible only by writing a plugin and calling it from a php script.
I remember once I came across such an extension, or a class. It allowed to execute c/c++ code. It became interesting how. I looked at the sources, everything turned out to be banal: the source was written to a temporary file, then compiled with gcc and executed. That's basically all))) A quick search did not find it (it was a long time ago), maybe you will be more lucky.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question