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

https://lukasrotermund.de/posts/php-array-object-benchmarking/

PHP arrays have driven me mad

Larry 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 #Zend

PHPで論理型を文字列に変換する際の言語仕様をリファレンスから調べる & php-srcのソースを書き換えて挙動を変えてみる
https://qiita.com/hi06ki/items/4f07f93834df1e3e4097?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items

#qiita #PHP #php_src

PHPで論理型を文字列に変換する際の言語仕様をリファレンスから調べる & php-srcのソースを書き換えて挙動を変えてみる - Qiita

最近 Laravel でWebアプリの開発を始めたのですが、PHP の言語仕様のうち論理型から文字列へのキャストが思っていた振る舞いと違っていたので仕様を調べてみました。環境M1 Mac 上に建…

Qiita