|
-
Jan 27th, 2004, 07:20 PM
#1
Thread Starter
Hyperactive Member
Is php compiled?
my friends says that php is compiled. I think it is just intercepted by the server and changed(rendered) into html and then your browser shows it to you. He thinks it compiles the source and the server runs the appilcation. Anyone know for sure?
-
Jan 27th, 2004, 07:21 PM
#2
PHP is a scripting language, however, there are compilers which can take a PHP script and turn it into a program.
Also, wrong forum and you could have confirmed this in .00000003547 seconds with google.
-
Jan 27th, 2004, 07:30 PM
#3
Thread Starter
Hyperactive Member
google really isnt giving me a straight answer. thanks for yours though.
-
Jan 27th, 2004, 07:43 PM
#4
Originally posted by BrandonTurner
google really isnt giving me a straight answer. thanks for yours though.
http://www.google.com/search?q=defin...utf-8&oe=utf-8
Very first definition on the very first line "scripting language".
-
Jan 28th, 2004, 04:07 PM
#5
Thread Starter
Hyperactive Member
yeah, i did that afterwards to prove it to him. As a side note... are you from genmay?
allnighte
-
Jan 28th, 2004, 05:50 PM
#6
Originally posted by BrandonTurner
yeah, i did that afterwards to prove it to him. As a side note... are you from genmay?
allnighte
I was from Genmay until M|22 paid for my SA membership and I haven't looked back since.
-
Jan 28th, 2004, 08:38 PM
#7
Thread Starter
Hyperactive Member
ahhh. why did he pay for the SA account, you like being a Goon?
-
Jan 28th, 2004, 08:46 PM
#8
Originally posted by BrandonTurner
ahhh. why did he pay for the SA account, you like being a Goon?
He paid for it because I was whinning about how the Admins were retards who couldn't do their job correctly and fairly. Sanjay responded by changing my name about 4 different times in 1 thread before M|22 bought me my SA membership and premium and then banned me.
Being a Goon is awesome.
-
Jan 28th, 2004, 10:17 PM
#9
PowerPoster
Aren't ALL languages compiled in one way or another? Even an interpreted language is changed/compiled so your computer can read it. It has to be turned into 1's and 0's otherwise your processor will spit it out. Where compiled into an executable or processed on the fly every language is compiled.
BTW, I am a professional PHP developer.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jan 28th, 2004, 10:34 PM
#10
Originally posted by Arc
Aren't ALL languages compiled in one way or another?
No. Scripting languages != Compiled
-
Jan 28th, 2004, 10:59 PM
#11
Originally posted by Spetnik
Some scripting languages are compiled at runtime. I don't know which, offhand, but I do know that some are.
.NET?
-
Jan 29th, 2004, 02:20 AM
#12
PowerPoster
A language can not be proccesed by a computer unless it has been compiled. Therefore PHP = compiled.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jan 29th, 2004, 02:38 AM
#13
Originally posted by Arc
A language can not be proccesed by a computer unless it has been compiled. Therefore PHP = compiled.
How did you come to that conclusion?
A compiled language is one which is run by being compiled into machine code. An interpreted language is one which is interpreted by a precompiled binary.
Yes - PHP has to be translated into machine code but this is done by a separate program. Where as a compiled program written in C would be able to run standalone.
-
Jan 29th, 2004, 03:49 AM
#14
Frenzied Member
PHP is not compiled in a sense that ASP .NET is. In fact there is a commercial solution available from Zend that tries to mimic compilation called Zend Accelerator.
BrandonTurner: Don't get into the argument of proving PHP is better or ASP or ASP .NET. It's just a headache, and almost always accompanied by prejudice.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Jan 29th, 2004, 01:16 PM
#15
Originally posted by Arc
A language can not be proccesed by a computer unless it has been compiled. Therefore PHP = compiled.
I thought you were a professional PHP developer?
-
Jan 29th, 2004, 01:26 PM
#16
Originally posted by Spetnik
I know many professional developers who have not a clue as to how languages work.
That's just...... bad
-
Jan 29th, 2004, 01:33 PM
#17
Originally posted by Spetnik
Why is that? They are good programmers, have jobs, and make money. What more do they need?
I think if you're using a language, you should know how it works.
-
Jan 29th, 2004, 01:51 PM
#18
There are indeed scripting languages that get compiled. E.g. the Rhino JavaScript engine, which is written in Java, can compile JavaScript to Java bytecode.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 29th, 2004, 01:53 PM
#19
Originally posted by CornedBee
There are indeed scripting languages that get compiled. E.g. the Rhino JavaScript engine, which is written in Java, can compile JavaScript to Java bytecode.
JavaScript isn't compiled by default, you have to use a 3rd party tool to do it. The same is with PHP (which I mentioned earlier). Some people actually develop applications in PHP. A scripting language, by deifnition, isn't compiled. Doesn't mean someone can't come along and make a compiler for it though.
-
Jan 29th, 2004, 01:54 PM
#20
Originally posted by Spetnik
You did not answer my question. Why would they need to know how it works if they are doing perfectly fine without it?
To better themselves? If you're a professional PHP developer but don't know how PHP works, that is pretty bad and they better hope no one finds out.
-
Jan 29th, 2004, 01:59 PM
#21
They could be doing better than just "perfectly fine" if they knew how the language works under the hood. I see it all the time with my brother. He hasn't got a clue about programming language fundamentals (don't confuse it with programming fundamentals), and thus his code could be far more efficient.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 29th, 2004, 02:23 PM
#22
Originally posted by kasracer
JavaScript isn't compiled by default, you have to use a 3rd party tool to do it.
By default?
That really leads only to a discussion about the definition of a scripting language. For example, emacs uses scripts written in a scripting language - but they always get compiled to some intermediate form.
Does that make it not a scripting language?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 29th, 2004, 02:43 PM
#23
Originally posted by Spetnik
I am not saying that knowing how a language does not help. All I am saying is that there are many professional programmers out there who do not know exactly how the technology works, yet they produce quality code, and are making large salaries, and therefore, they have no immediate need to learn what goes on at the low-level of their systems. That's all .
I highly doubt they're producing 'quality code'
-
Jan 29th, 2004, 02:44 PM
#24
Originally posted by CornedBee
By default?
That really leads only to a discussion about the definition of a scripting language. For example, emacs uses scripts written in a scripting language - but they always get compiled to some intermediate form.
Does that make it not a scripting language?
Then it wouldn't be a scripting language. Google's definitions are NEVER WRONG!
scripting language - A scripting language differentiates itself from other typical languages in that they are usually simpler to learn and use as well as not needing to be compiled. The language is interpreted at run-time so you can execuate instructions immediately.
-
Jan 29th, 2004, 03:11 PM
#25
Scripting Language != Script but those definitions don't disprove what I said.
-
Jan 30th, 2004, 01:02 PM
#26
Thread Starter
Hyperactive Member
one of the thing i thought about to logically prove my point was the fact that there is such a thing as PHP injection exploits. If it was compiled putting code into the program would just mess up the program not cause it to do what you put into it. Then my friend said that it is possible to have injection becuase it is compiled line by line as it goes during run time which sounded reasonable i guess.
-
Jan 30th, 2004, 03:38 PM
#27
Originally posted by Spetnik
I am not saying that knowing how a language does not help. All I am saying is that there are many professional programmers out there who do not know exactly how the technology works, yet they produce quality code, and are making large salaries, and therefore, they have no immediate need to learn what goes on at the low-level of their systems. That's all .
You are right about that.
My very nature is to question things and that is the only reason I know how VB programs and C programs are compiled and it does give you an upper hand beucase sooner or later there will be an error in the compiling or linking of a program and you're screwed if you have never seen that kind of error before.
-
Jan 30th, 2004, 05:06 PM
#28
Originally posted by BrandonTurner
one of the thing i thought about to logically prove my point was the fact that there is such a thing as PHP injection exploits. If it was compiled putting code into the program would just mess up the program not cause it to do what you put into it. Then my friend said that it is possible to have injection becuase it is compiled line by line as it goes during run time which sounded reasonable i guess.
No, you're getting the program to jump from the interpreter's code to the malicious injected code.
Compiling line by line as you go through a program is horribly inefficient - compiling a line takes longer than interpreting it.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 31st, 2004, 03:35 AM
#29
-
Jan 31st, 2004, 04:40 AM
#30
Its more than just translating the source code into machine code.
If you did that then your program wouldn't work.
-
Jan 31st, 2004, 05:54 AM
#31
No, arc, not all languages must be compiled. Interpretation means to invoke already existing machine code bits according to a text pattern. This is not compilation, where machine code is created according to a text pattern.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 31st, 2004, 10:04 AM
#32
I wonder how many charact
Unless any of you have built a compiler, I guess you are disguising intelligence on the matter behind what you have read in a book, or on the web.
Look at Java for instance... it's a supposed write-once run-everywhere platform. That's all fine for the programmer, but not the guy that has to create a compiler for that bytecode for each processor platform on the market.
-
Jan 31st, 2004, 11:30 AM
#33
Addicted Member
-
Jan 31st, 2004, 12:16 PM
#34
Originally posted by nemaroller
Unless any of you have built a compiler, I guess you are disguising intelligence on the matter behind what you have read in a book, or on the web.
Look at Java for instance... it's a supposed write-once run-everywhere platform. That's all fine for the programmer, but not the guy that has to create a compiler for that bytecode for each processor platform on the market.
I'm not disguising anything. What I talk about here is indeed mainly what I've learned from books or the web. But no matter the source of my knowledge, I have this knowledge, unlike some other people here.
And what has your Java example to do with it? This guy gets paid by Sun for what he does.
powdir: I don't know what a glowing complexion is, but the others are all true
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 31st, 2004, 03:05 PM
#35
I wonder how many charact
Point of the JAVA example:
It distinguishes between the programmer (user), who knows nothing of what goes on under the hood, from the engineer (supplier), that wrote the code to convert it to machine language. You may read the white papers and comprehend how it works, but unless you wrote the code, you can't ever truly understand how it works.
In context of this debate of php being compiled... A person may know C++, ASM, JAVA, and/or PHP. And all those don't work unless compiled or interpreted into machine code for a specific processor.
-
Jan 31st, 2004, 04:22 PM
#36
The difference between compilation and interpretation is that interpretation doesn't translate to machine code, never.
"Interpreted to machine code" doesn't have a meaning.
You may read the white papers and comprehend how it works, but unless you wrote the code, you can't ever truly understand how it works.
Sure I can. I don't understand every detail, but I understand the process. And this is what we're talking about here. The question is not, "to what machine code is PHP compiled", but "is PHP compiled at all". Unless I wrote the PHP "compiler" (whatever), I couldn't answer the first question, but I can answer the second.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 31st, 2004, 05:45 PM
#37
Originally posted by Arc
Randomly spouted stuff here
We already know what you ment and it is wrong. Sorry Mr. PHP Professional.
-
Feb 1st, 2004, 01:04 AM
#38
PowerPoster
Originally posted by Spetnik
Wrong. A scripting language is not translated into machine code, because it is not processed by the operating system directly. It is processed by the scripting engine, which is a precompiled application that performs tasks based on code written in the script. The same way that machine code is what the operating system understands, so too, the actual scripting code is what the scripting engine understands.
The final result is that that PHP script is eventually translated into MACHINE CODE! It has to be one way or another. Whether directly compiled or translated through a pre compiled parsing engine it is still translated into machine code.
Why is this so hard to understand?
And as stated above the definition of compile is to translate into machine code. How it got translated is irrelevant.
But if you want to go by the normal consensus, then no PHP is not recognized as a "compiled" language, even though technically all languages are.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Feb 1st, 2004, 02:04 AM
#39
Originally posted by Arc
The final result is that that PHP script is eventually translated into MACHINE CODE! It has to be one way or another. Whether directly compiled or translated through a pre compiled parsing engine it is still translated into machine code.
Why is this so hard to understand?
It's so hard to understand WRONG consepts. Just stop when you're beaten. PHP is not compiled, which you first said. You're slowly changing your wording to try and make it look like you're right.
Originally posted by Arc
But if you want to go by the normal consensus, then no PHP is not recognized as a "compiled" language, even though technically all languages are.
This is the dumbest, most ignorant comment I've ever seen on a forum.
If I were you, I'd just delete that post and make like nothing ever happened, seriously......
-
Feb 1st, 2004, 05:35 AM
#40
Slow down kas.
Arc, you seem to have a wrong concept of what "compiled" means. I'm strongly considering writing a tiny scripting language to show you where you are wrong, but I'm pretty busy.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|