In an article titled
How big are PHP arrays (and values) really? (Hint: Big!), an engineer at github made some measurements on a PHP array of 100 000 integers. We know a C/C++
long is 8byte on a 64-bit machine, 100 000 longs should be 800 000 bytes or approx 0.78MB. Instead in PHP, it's 13.97MB.
The article goes on to explain where the huge overhead comes from and makes some introspection in the PHP stack. Read it.
Obviously this is not just a PHP issue, you have to expect dynamic languages like that to introduce overhead.
In the spirit of comparison, a 100 000 int tuple in python is around 8MB. I will be doing some inspections to understand the differences between PHP and Python.
Is anyone interested in doing so for another dynamic language? The ones I'm most curious about are Ruby, Groovy and Java.