101010.pl is one of the many independent Mastodon servers you can use to participate in the fediverse.
101010.pl czyli najstarszy polski serwer Mastodon. Posiadamy wpisy do 2048 znaków.

Server stats:

521
active users

#php_src

0 posts0 participants0 posts today

I'm obsessed. 50% memory savings with PHP arrays have driven me crazy 🤪

For the past few weeks, my after-work research on PHP arrays has dominated my free time. The 'Never* use arrays' talk by @Crell at PHPKonf 2021 and a misinterpreted statement that you can save ~50% memory with PHP arrays have triggered intensive research on the topic.

[1/2]

#php #php_src #web_development #development #C #array #php_array

lukasrotermund.de/posts/php-ar

lukasrotermund.de · PHP arrays have driven me madLarry Garfield's 'Never* use arrays' talk really confused me. How can it be that objects in PHP save 50% memory? How can every PHP developer not be excited about this? And why don't you hear about it anywhere?

If I have a fresh array in #PHP and start adding auto-indexed already initialised values, are these then moved into the memory area of zend_array's `arPacked`, are new zvals added here which then reference the other ones, or does the "array" then become a hash map? I'm just trying to understand PHP's array implementation in detail :)

In addition, if anyone has a link to Github / a documentation where you can see what is happening, I would be super happy :D

#C#PHP_SRC#PHP_CORE