Skip to content
Permalink
Browse files

Renumber ZEND_ACC_... flags

  • Loading branch information
dstogov committed Sep 11, 2018
1 parent 1570fe1 commit 0fbd2e6a168a5cfacec6c44f4c179879a52428f3
@@ -51,6 +51,13 @@ PHP 7.4 UPGRADE NOTES
9. Other Changes to Extensions
========================================

- Reflection:
. Numeric value of class, property, function and constant modifiers was
changed. Don't filter methods and properties through
ReflectionClass::getMethods() and ReflectionClass::getProperties(), or test
results of Reflection...::getModifiers(), using hard-coded numeric values.
Use corresponding constants instead (e.g. ReflectionMethod::IS_PUBLIC).

========================================
10. New Global Constants
========================================
@@ -3,7 +3,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES
1. Internal API changes
a. php_sys_symlink() and php_sys_link()
b. zend_lookup_class_ex() and zend_fetch_class_by_name()
c. Function/property flags
c. Function/property/class flags

2. Build system changes
a. Unix build system changes
@@ -23,7 +23,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES
changed to accept optional lower-case class name as zend_string*,
instead of zval*.

c. Function/property flags changes
c. Function/property/class flags changes
- ZEND_ACC_CTOR and ZEND_ACC_DTOR are removed. It's possible to check if
method is a constructor/destructor using the following condition
(func->commpon.scope->constructor == func).
@@ -33,6 +33,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES
- ZEND_ACC_SHADOW property flag is removed. Instead of creating shadow
clone, now we use the same private property_info, and should also
check property_info->ce (in the same way as with methods).
- ZEND_ACC_... flags are re-numbered.

========================
2. Build system changes
@@ -201,121 +201,117 @@ typedef struct _zend_oparray_context {
/* Common flags | | | */
/* ============ | | | */
/* | | | */
/* Visibility flags (public < protected < private) | | | */
#define ZEND_ACC_PUBLIC (1 << 0) /* | X | X | X */
#define ZEND_ACC_PROTECTED (1 << 1) /* | X | X | X */
#define ZEND_ACC_PRIVATE (1 << 2) /* | X | X | X */
/* | | | */
/* Property or method overrides private one | | | */
#define ZEND_ACC_CHANGED (1 << 3) /* | X | X | */
/* | | | */
/* Staic method or property | | | */
#define ZEND_ACC_STATIC (1 << 0) /* | X | X | */
#define ZEND_ACC_STATIC (1 << 4) /* | X | X | */
/* | | | */
/* Final class or method | | | */
#define ZEND_ACC_FINAL (1 << 2) /* X | X | | */
#define ZEND_ACC_FINAL (1 << 5) /* X | X | | */
/* | | | */
/* Visibility flags (public < protected < private) | | | */
#define ZEND_ACC_PUBLIC (1 << 8) /* | X | X | X */
#define ZEND_ACC_PROTECTED (1 << 9) /* | X | X | X */
#define ZEND_ACC_PRIVATE (1 << 10) /* | X | X | X */
/* | | | */
/* Property or method overrides private one | | | */
#define ZEND_ACC_CHANGED (1 << 11) /* | X | X | */
/* Abstarct method | | | */
#define ZEND_ACC_ABSTRACT (1 << 6) /* X | X | | */
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS (1 << 6) /* X | | | */
/* | | | */
/* Class Flags (unused: 0, 1, 3, 11-18, 21, 25...) | | | */
/* Class Flags (unused: 15...) | | | */
/* =========== | | | */
/* | | | */
/* Special class types | | | */
#define ZEND_ACC_INTERFACE (1 << 0) /* X | | | */
#define ZEND_ACC_TRAIT (1 << 1) /* X | | | */
#define ZEND_ACC_ANON_CLASS (1 << 2) /* X | | | */
/* | | | */
/* Bound anonymous class | | | */
#define ZEND_ACC_ANON_BOUND (1 << 3) /* X | | | */
/* | | | */
/* class is abstarct, since it is set by any | | | */
/* abstract method | | | */
#define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS (1 << 4) /* X | | | */
/* | | | */
/* Class is explicitly defined as abstract by using | | | */
/* the keyword. | | | */
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS (1 << 5) /* X | | | */
/* | | | */
/* Special class types | | | */
#define ZEND_ACC_INTERFACE (1 << 6) /* X | | | */
#define ZEND_ACC_TRAIT (1 << 7) /* X | | | */
#define ZEND_ACC_ANON_CLASS (1 << 8) /* X | | | */
/* Class has magic methods __get/__set/__unset/ | | | */
/* __isset that use guards | | | */
#define ZEND_ACC_USE_GUARDS (1 << 7) /* X | | | */
/* | | | */
/* Bound anonymous class | | | */
#define ZEND_ACC_ANON_BOUND (1 << 9) /* X | | | */
/* Class constants updated | | | */
#define ZEND_ACC_CONSTANTS_UPDATED (1 << 8) /* X | | | */
/* | | | */
/* Class extends another class | | | */
#define ZEND_ACC_INHERITED (1 << 10) /* X | | | */
#define ZEND_ACC_INHERITED (1 << 9) /* X | | | */
/* | | | */
/* Class extends another class | | | */
#define ZEND_ACC_UNRESOLVED_PARENT (1 << 11) /* X | | | */
#define ZEND_ACC_UNRESOLVED_PARENT (1 << 10) /* X | | | */
/* | | | */
/* Class implements interface(s) | | | */
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 19) /* X | | | */
/* | | | */
/* Class constants updated | | | */
#define ZEND_ACC_CONSTANTS_UPDATED (1 << 20) /* X | | | */
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 11) /* X | | | */
/* | | | */
/* Class implements interface(s) | | | */
#define ZEND_ACC_UNRESOLVED_INTERFACES (1 << 21) /* X | | | */
#define ZEND_ACC_UNRESOLVED_INTERFACES (1 << 12) /* X | | | */
/* | | | */
/* Class uses trait(s) | | | */
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 22) /* X | | | */
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 13) /* X | | | */
/* | | | */
/* User class has methods with static variables | | | */
#define ZEND_HAS_STATIC_IN_METHODS (1 << 23) /* X | | | */
#define ZEND_HAS_STATIC_IN_METHODS (1 << 14) /* X | | | */
/* | | | */
/* Class has magic methods __get/__set/__unset/ | | | */
/* __isset that use guards | | | */
#define ZEND_ACC_USE_GUARDS (1 << 24) /* X | | | */
/* | | | */
/* Function Flags (unused: 4, 5, 17?) | | | */
/* Function Flags (unused: 25...30) | | | */
/* ============== | | | */
/* | | | */
/* Abstarct method | | | */
#define ZEND_ACC_ABSTRACT (1 << 1) /* | X | | */
/* Immutable op_array (lazy loading) | | | */
#define ZEND_ACC_IMMUTABLE (1 << 7) /* | X | | */
/* | | | */
#define ZEND_ACC_FAKE_CLOSURE (1 << 6) /* | X | | */
/* deprecation flag | | | */
#define ZEND_ACC_DEPRECATED (1 << 8) /* | X | | */
/* | | | */
/* method flag used by Closure::__invoke() | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 7) /* | X | | */
/* Function returning by reference | | | */
#define ZEND_ACC_RETURN_REFERENCE (1 << 9) /* | X | | */
/* | | | */
/* Function has typed arguments | | | */
#define ZEND_ACC_HAS_TYPE_HINTS (1 << 10) /* | X | | */
/* | | | */
/* Function has a return type | | | */
#define ZEND_ACC_HAS_RETURN_TYPE (1 << 11) /* | X | | */
/* | | | */
/* Function with variable number of arguments | | | */
#define ZEND_ACC_VARIADIC (1 << 12) /* | X | | */
/* | | | */
/* op_array has finally blocks (user only) | | | */
#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 13) /* | X | | */
/* | | | */
/* "main" op_array with | | | */
/* ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes | | | */
#define ZEND_ACC_EARLY_BINDING (1 << 15) /* | X | | */
#define ZEND_ACC_EARLY_BINDING (1 << 14) /* | X | | */
/* | | | */
/* method flag (bc only), any method that has this | | | */
/* flag can be used statically and non statically. | | | */
#define ZEND_ACC_ALLOW_STATIC (1 << 16) /* | X | | */
/* | | | */
/* deprecation flag | | | */
#define ZEND_ACC_DEPRECATED (1 << 18) /* | X | | */
/* | | | */
#define ZEND_ACC_NO_RT_ARENA (1 << 19) /* | X | | */
/* | | | */
#define ZEND_ACC_CLOSURE (1 << 20) /* | X | | */
#define ZEND_ACC_ALLOW_STATIC (1 << 15) /* | X | | */
/* | | | */
/* call through user function trampoline. e.g. | | | */
/* __call, __callstatic | | | */
#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 21) /* | X | | */
#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 16) /* | X | | */
/* | | | */
/* disable inline caching | | | */
#define ZEND_ACC_NEVER_CACHE (1 << 22) /* | X | | */
/* | | | */
#define ZEND_ACC_GENERATOR (1 << 23) /* | X | | */
/* | | | */
/* Function with variable number of arguments | | | */
#define ZEND_ACC_VARIADIC (1 << 24) /* | X | | */
/* | | | */
/* Immutable op_array (lazy loading) | | | */
#define ZEND_ACC_IMMUTABLE (1 << 25) /* | X | | */
#define ZEND_ACC_NEVER_CACHE (1 << 17) /* | X | | */
/* | | | */
/* Function returning by reference | | | */
#define ZEND_ACC_RETURN_REFERENCE (1 << 26) /* | X | | */
/* Closure related | | | */
#define ZEND_ACC_CLOSURE (1 << 18) /* | X | | */
#define ZEND_ACC_FAKE_CLOSURE (1 << 19) /* | X | | */
#define ZEND_ACC_NO_RT_ARENA (1 << 20) /* | X | | */
/* | | | */
#define ZEND_ACC_DONE_PASS_TWO (1 << 27) /* | X | | */
/* method flag used by Closure::__invoke() | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 21) /* | X | | */
/* | | | */
/* Function has typed arguments | | | */
#define ZEND_ACC_HAS_TYPE_HINTS (1 << 28) /* | X | | */
#define ZEND_ACC_GENERATOR (1 << 22) /* | X | | */
/* | | | */
/* op_array has finally blocks (user only) | | | */
#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 29) /* | X | | */
#define ZEND_ACC_DONE_PASS_TWO (1 << 23) /* | X | | */
/* | | | */
/* internal function is allocated at arena (int only) | | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 29) /* | X | | */
/* | | | */
/* Function has a return type | | | */
#define ZEND_ACC_HAS_RETURN_TYPE (1 << 30) /* | X | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 24) /* | X | | */
/* | | | */
/* op_array uses strict mode types | | | */
#define ZEND_ACC_STRICT_TYPES (1 << 31) /* | X | | */
@@ -40,47 +40,47 @@ isPrivate: no
isProtected: no
isStatic: no
isDefault: yes
Modifiers: 256
Modifiers: 1

Inspecting property 'client_version'
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isDefault: yes
Modifiers: 256
Modifiers: 1

Inspecting property 'driver_version'
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isDefault: yes
Modifiers: 256
Modifiers: 1

Inspecting property 'embedded'
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isDefault: yes
Modifiers: 256
Modifiers: 1

Inspecting property 'reconnect'
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isDefault: yes
Modifiers: 256
Modifiers: 1

Inspecting property 'report_mode'
isPublic: yes
isPrivate: no
isProtected: no
isStatic: no
isDefault: yes
Modifiers: 256
Modifiers: 1
Default property 'client_info'
Default property 'client_version'
Default property 'driver_version'

0 comments on commit 0fbd2e6

Please sign in to comment.
You can’t perform that action at this time.