summaryrefslogtreecommitdiff
path: root/Zend/zend_type_info.h
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-09-25 13:21:13 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-11-08 15:15:48 +0100
commit999e32b65a8a4bb59e27e538fa68ffae4b99d863 (patch)
tree9b6c69d032b9b69fff2f3b71f95ad2566cdf4acb /Zend/zend_type_info.h
parentac4e0f0852ce780e143013ceff45067a172e8a83 (diff)
downloadphp-git-999e32b65a8a4bb59e27e538fa68ffae4b99d863.tar.gz
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.
Diffstat (limited to 'Zend/zend_type_info.h')
-rw-r--r--Zend/zend_type_info.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Zend/zend_type_info.h b/Zend/zend_type_info.h
index 9479d5aad2..ef2c6a19bc 100644
--- a/Zend/zend_type_info.h
+++ b/Zend/zend_type_info.h
@@ -25,6 +25,7 @@
#define MAY_BE_NULL (1 << IS_NULL)
#define MAY_BE_FALSE (1 << IS_FALSE)
#define MAY_BE_TRUE (1 << IS_TRUE)
+#define MAY_BE_BOOL (MAY_BE_FALSE|MAY_BE_TRUE)
#define MAY_BE_LONG (1 << IS_LONG)
#define MAY_BE_DOUBLE (1 << IS_DOUBLE)
#define MAY_BE_STRING (1 << IS_STRING)