Description
Description
Classes are very often used as a simple data holding structure which is created and destroyed millions times per script lifecycle/run.
In https://3v4l.org/CMktE/rfc#vgit.master I have discovered a "class like struct" is slower than an array. This is something not fully surprising on the first sight.
However, https://3v4l.org/hSSFJ/rfc#vgit.master, same demo with propoted properties only, with empty constructor, is not (much if any) faster.
Initially I thought the interpreted code in the constructor will contribute the most to the total run time. This seems to be not true, it seems the most of the time is spent in object allocation and release. If an object has no cycles, it should be fast. I hope there is a room to optimize the object allocation/release more and make this core part of php faster.
let's focus on typed property assign performance solely here
repro: https://3v4l.org/FGeEf