Skip to content

Tag: php-internals

What is the actual memory cost of storing an integer?

lets say I just do this So I store 10 integers in an array. If the integer is a 32b one, the memory cost should be 40 bytes. Problem is, I didn’t tell php that it is an integer so it either has to store it as something else? (js likes to make doubles for example) or keep extra data