Conversation
Introduced in phpGH-8945 With RETURN_EMPTY_ARRAY this function can now return an interned array which has refcount 2.
|
Has |
|
@iluuu1994 why did the GH nightly testing not fail? - https://github.com/php/php-src/actions/runs/2674123034 |
|
@mvorisek Nightly still isn't fully migrated. Look at the job configuration, you'll see that they are different. Refcount information is used in the optimizer, so potentially yes. But the difference is likely negligible, and an empty array will be faster than the previous array containing an empty string as an empty array doesn't cause any allocations. |
|
That is my point. When "empty array doesn't cause any allocations", what is the purpose of interning such value then? Maybe there are more places where "better" |
|
An empty array would require an allocation; this is why we use a statically allocated empty array. To avoid that this ever gets freed, it has a refcount of 2. |
See test failure in nightly.
Introduced in GH-8945
With RETURN_EMPTY_ARRAY this function can now return an interned array which
has refcount 2.