History log of /PHP-8.0/Zend/zend_types.h (Results 1 – 25 of 243)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 880bf622 14-Jan-2021 Nikita Popov

Fixed bug #80617: Type narrowing warning in ZEND_TYPE_INIT_CODE


Revision tags: php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4
# da0663a3 15-Sep-2020 Nikita Popov

Add GC_TRY_ADDREF macro

That adds a ref if not immutable. Also audit uses of GC_IMMUTABLE
to either use GC_TRY_ADDREF or GC_TRY_PROTECT_RECURSION.


Revision tags: php-7.4.11RC1, php-7.3.23RC1, php-8.0.0beta3, php-7.4.10, php-7.3.22
# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...


Revision tags: php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1, php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21, php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20, php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1
# 15846ff1 17-Jun-2020 Nikita Popov

Add ZVAL_OBJ_COPY macro

For the common ZVAL_OBJ + GC_ADDREF pattern.
This mirrors the existing ZVAL_STR_COPY API.


# bb3d4456 15-Jun-2020 Dmitry Stogov

Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() check


Revision tags: php-7.4.7, php-7.3.19
# 4b77a158 08-Jun-2020 George Peter Banyard

Use standard boolean type as zend_bool typedef

Closes GH-5624


Revision tags: php-7.4.7RC1, php-7.3.19RC1, php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17, php-7.4.5RC1, php-7.3.17RC1
# aec4c0fd 27-Mar-2020 Máté Kocsis

Add support for the mixed type

RFC: https://wiki.php.net/rfc/mixed_type_v2
Closes GH-5313

Co-authored-by: Dan Ackroyd <danack@basereality.com>


# 446724bc 12-Apr-2020 George Peter Banyard

Fix [-Werror=missing-braces] compiler warning

Partial fix to bug 79431


Revision tags: php-7.3.18, php-7.4.4, php-7.2.29, php-7.3.16, php-7.4.4RC1, php-7.3.16RC1, php-7.4.3, php-7.2.28, php-7.3.15RC1, php-7.4.3RC1, php-7.3.15, php-7.2.27, php-7.4.2, php-7.3.14
# 43443857 07-Jan-2020 Nikita Popov

Add static return type

RFC: https://wiki.php.net/rfc/static_return_type

The "static" type is represented as MAY_BE_STATIC, rather than
a class type like "self" and "parent", as

Add static return type

RFC: https://wiki.php.net/rfc/static_return_type

The "static" type is represented as MAY_BE_STATIC, rather than
a class type like "self" and "parent", as it has special
resolution semantics, and cannot be cached in the runtime cache.

Closes GH-5062.

show more ...


# 437404b0 11-Feb-2020 Dmitry Stogov

Reuse SEPARATE_ARRAY() macro


# bd197728 16-Jan-2020 Nikita Popov

Use zend_type inside type lists

Instead of having a completely independent encoding for type list
entries. This is going to use more memory, but I'm not particularly
concerned about

Use zend_type inside type lists

Instead of having a completely independent encoding for type list
entries. This is going to use more memory, but I'm not particularly
concerned about that, as type unions that contain multiple classes
should be uncommon. On the other hand, this allows us to treat
top-level types and types inside lists mostly the same.

A new ZEND_TYPE_FOREACH macros allows to transparently treat list
and non-list types the same way. I'm not using it everywhere it could be
used for now, just the places that seemed most obvious.

Of course, this will make any future type system changes much simpler,
as it will not be necessary to duplicate all logic two times.

show more ...


# 0b4778c3 16-Jan-2020 Máté Kocsis

Fix #78880: Another bunch of spelling errors


# 1e4920c1 07-Jan-2020 Nikita Popov

Renumber zval types, clarify allowed overlap

Make it clear that types used for type declarations can overlap
with the rest, and can also overlap in MAY_BE space.

This makes thin

Renumber zval types, clarify allowed overlap

Make it clear that types used for type declarations can overlap
with the rest, and can also overlap in MAY_BE space.

This makes things more robust against the addition of new primitive
types.

show more ...


Revision tags: php-7.3.14RC1, php-7.4.2RC1, php-7.4.1, php-7.2.26, php-7.3.13
# 3280209c 11-Dec-2019 Dmitry Stogov

Addirional fix for bug #78918


Revision tags: php-7.4.1RC1, php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12
# 0cec268d 15-Nov-2019 Nikita Popov

Support single class unions in gen stubs


Revision tags: php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5, php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1, php-7.4.0RC3
# 999e32b6 25-Sep-2019 Nikita Popov

Implement union types

According to RFC: https://wiki.php.net/rfc/union_types_v2

The type representation now makes use of both the pointer payload
and the type mask at the same t

Implement union types

According to RFC: https://wiki.php.net/rfc/union_types_v2

The type representation now makes use of both the pointer payload
and the type mask at the same time. Additionall, zend_type_list is
introduced as a new kind of pointer payload, which is used to store
multiple class types. Each of the class types is a tagged pointer,
which may be either a class name or class entry. The latter is only
used for typed properties, while arguments/returns will instead use
cache slots. A type list can contain a mix of both names and CEs at
the same time, as not all classes may be resolvable.

One thing this is missing is support for union types in arginfo
and stubs, which I want to handle separately.

I've also dropped the special object code from the JIT implementation
for now -- I plan to add this back in a different form at a later time.
For now I did not want to include non-trivial JIT changes together
with large functional changes.

Another possible piece of follow-up work is to implement "iterable"
as an internal alias for "array|Traversable". I believe this will
eliminate quite a few special-cases that had to be implemented.

Closes GH-4838.

show more ...


Revision tags: php-7.2.23, php-7.3.10
# ac4e0f08 20-Sep-2019 Nikita Popov

Make zend_type a 2-field struct

We now store the pointer payload and the type mask separately. This
is in preparation for union types, where we will be using both at
the same time.

Make zend_type a 2-field struct

We now store the pointer payload and the type mask separately. This
is in preparation for union types, where we will be using both at
the same time.

To avoid increasing the size of arginfo structures, the
pass_by_reference and is_variadic fields are now stored as part of
the type_mask (8-bit are reserved for custom use).

Different types of pointer payloads are distinguished based on bits
in the type_mask.

show more ...


# 944c1cf0 01-Nov-2019 Nikita Popov

Fixed bug #78768

Remove the typedef from zend_types.h, use explicit struct prefix
instead.


# 9d48bf51 27-Oct-2019 Tyson Andre

Fix miscellaneous typos in docs and error messages

Closes GH-4863.


# f1848a4b 24-Oct-2019 Nikita Popov

Fix bug #78226: Don't call __set() on uninitialized typed properties

Assigning to an uninitialized typed property will no longer trigger
a call to __set(). However, calls to __set() are

Fix bug #78226: Don't call __set() on uninitialized typed properties

Assigning to an uninitialized typed property will no longer trigger
a call to __set(). However, calls to __set() are still triggered if
the property is explicitly unset().

This gives us both the behavior people generally expect, and still
allows ORMs to do lazy initialization by unsetting properties.

For PHP 8, we should fine a way to forbid unsetting of declared
properties entirely, and provide a different way to achieve lazy
initialization.

show more ...


# 2128c634 23-Sep-2019 Nikita Popov

Check that type is set in ZEND_TYPE_IS_MASK()

Allow this macro to be used without an explicit ZEND_TYPE_IS_SET()
check.


# 3012d006 23-Sep-2019 Nikita Popov

Don't set nullability flag for parameters without type

Use value 0 instead. To compensate we check in ReflectionParameter
allowsNull() whether the type is set at all: If it isn't, it alw

Don't set nullability flag for parameters without type

Use value 0 instead. To compensate we check in ReflectionParameter
allowsNull() whether the type is set at all: If it isn't, it always
allows null.

This removes a discrepancy between internal&userland functions:
For userland functions allowsNull() on untyped parameters returned
true, but for internal functions it returned false.

show more ...


# 9e8ba789 19-Sep-2019 Nikita Popov

Change representation of zend_type from type code to MAY_BE_* mask

This switches zend_type from storing a single IS_* type code to
storing a MAY_BE_* type mask. Right now most code still

Change representation of zend_type from type code to MAY_BE_* mask

This switches zend_type from storing a single IS_* type code to
storing a MAY_BE_* type mask. Right now most code still assumes
that there is only a single type in the mask (or two together
with MAY_BE_NULL). But this will make it a lot simpler to introduce
union types.

An additional advantage (and why I'm doing this separately), is
that a number of special cases no longer need to be handled
separately: We can do a single mask & (1 << type) check to handle
all simple types, booleans (true|false) and null.

show more ...


Revision tags: php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1
# 7bd2b9d2 13-Aug-2019 Nikita Popov

Generalize delref assertion

The refcount should never become negative, not just during GC.


Revision tags: php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1
# d57d74b2 10-Jul-2019 Dmitry Stogov

Reduce cost for references to strings and resources


12345678910