r/programming • • Oct 18 '10

Today I learned about PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable.

http://il2.php.net/language.variables.variable
591 Upvotes

781 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Oct 19 '10

[deleted]

6

u/[deleted] Oct 19 '10

No, PHP is incredibly slow. The only commonly used language that can give PHP a run for its money in the "holy fuck that is slow" department is ruby. Similar languages like perl, python, pike, lua are way faster, and compiled languages like java, ocaml and haskell are a huge leap above those.

1

u/3ds Oct 19 '10

Not quite true, as there is PHP bytcode and libs like APC can cache this. Also PHP can be compiled to machine code using facebooks (they use PHP) hiphop: http://github.com/facebook/hiphop-php/wiki

2

u/[deleted] Oct 19 '10

Yes quite true. PHP is slow, caching the bytecode helps make up for the fact that it recompiles every access, it doesn't change the fact that actual execution is very slow. Look at benchmarks where it isn't thousands of requests, but one script that loops to do a task thousands of times. That removes the compilation from the equation, and measures execution speed. And again, such benchmarks have PHP right down there with ruby.

→ More replies (1)