0

Possible Duplicate:
Which is faster, python webpages or php webpages?

I've seen people trying to run PHP and Python on some code and compare their speed...usually Python wins

Is this true in general? Is python generally faster than PHP and if so how much is the difference?

Community
  • 1
  • 1
kamikaze_pilot
  • 12,874
  • 29
  • 103
  • 169
  • Please elaborate on "in general" and "generally faster". – MattH May 09 '11 at 15:43
  • 3
    This is not really a worthwhile question to ask when deciding whether to use Python or PHP. – Hammerite May 09 '11 at 15:44
  • @Pekka, that answer was given in 2008, some things had changed. – OZ_ May 09 '11 at 15:46
  • @OZ_ what in the accepted answer has fundamentally changed since 2008? As far as I can see, most what is said there still applies. – Pekka May 09 '11 at 15:47
  • 1
    If benchmarks will be written by fan of Python, Python will be winner. Otherwise - PHP. – OZ_ May 09 '11 at 15:49
  • 4
    @OZ_ The answer is still accurate, and as @Hammerite mentions, *it's really not the best question to ask*. A better question (although perhaps not appropriate for SO?) would be "Which programming language makes you smile every day and wake up excited to hack on something new?" The answer of course is Python. – zeekay May 09 '11 at 15:51
  • @Pekka: This question talks about the languages themselves, not the web frameworks surrounding them. It's related to that question, but I don't think it's a duplicate. More appropriate is @Hammerite's comment about the pointlessness of asking the question. As long as it's fewer than 2 or 3 orders of magnitude, and it's possible to call functions written in a compiled language somehow, this is at best a tiebreaker. – nmichaels May 09 '11 at 15:53
  • @zeekay Python has very ugly syntax. I can't understand, how can he make somebody smile. But, of course, it's just my opinion, not less and not more subjective than yours :) – OZ_ May 09 '11 at 15:54
  • @zeekay same as you. But, if seriously, it will be useful to compare code of real tasks (not 'hello world'), written in PHP and Python. I don't have anything against Python, but I don't see reasons to learn this language, when I can complete my tasks in PHP, and in PHP I'm not as newbie, as in Python (it's mean that in Python I will have to build my way again, through mistakes). – OZ_ May 09 '11 at 16:05
  • 6
    @OZ_ I wrote PHP web apps for several years, and eventually wrote my own framework, primarily to make AJAX-based web apps easier to write/maintain. I learned Python as a result of frustrations with PHP and I that was the best thing I ever did. In my personal experience it's far easier to write, maintain, and optimize Python web apps. You only stand to profit! Remember how long it took you to become competent with PHP? You can learn Python at a very high level of competency in a week. It's a much better designed language for all manner of reasons in my *subjective opinion*. – zeekay May 09 '11 at 16:21

0 Answers0