@@ -19,6 +19,12 @@ PHP 8.3 UPGRADE NOTES
19
19
1. Backward Incompatible Changes
20
20
========================================
21
21
22
+ - Core:
23
+ . Programs that were very close to overflowing the call stack may now throw an
24
+ Error when using more than
25
+ `zend.max_allowed_stack_size-zend.reserved_stack_size` bytes of stack
26
+ (`fiber.stack_size-zend.reserved_stack_size` for fibers).
27
+
22
28
========================================
23
29
2. New Features
24
30
========================================
@@ -104,6 +110,26 @@ PHP 8.3 UPGRADE NOTES
104
110
11. Changes to INI File Handling
105
111
========================================
106
112
113
+ - zend.max_allowed_stack_size
114
+ . New INI directive to set the maximum allowed stack size. Possible
115
+ values are `0` (detect the process or thread maximum stack size), `-1`
116
+ (no limit), or a positive number of bytes. The default is `0`. When it
117
+ is not possible to detect the the process or thread maximum stack size,
118
+ a known system default is used. Setting this value too high has the same
119
+ effect as disabling the stack size limit. Fibers use fiber.stack_size
120
+ as maximum allowed stack size. An Error is thrown when the process call
121
+ stack exceeds `zend.max_allowed_stack_size-zend.reserved_stack_size`
122
+ bytes, to prevent stack-overflow-induced segmentation faults, with
123
+ the goal of making debugging easier. The stack size increases during
124
+ uncontrolled recursions involving internal functions or the magic methods
125
+ __toString, __clone, __sleep, __destruct. This is not related to stack
126
+ buffer overflows, and is not a security feature.
127
+
128
+ - zend.reserved_stack_size
129
+ . New INI directive to set the reserved stack size, in bytes. This is
130
+ subtracted from the max allowed stack size, as a buffer, when checking the
131
+ stack size.
132
+
107
133
========================================
108
134
12. Windows Support
109
135
========================================
@@ -112,6 +138,13 @@ PHP 8.3 UPGRADE NOTES
112
138
13. Other Changes
113
139
========================================
114
140
141
+ - Core:
142
+ . An Error is now thrown when the process call stack exceeds a certain size,
143
+ to prevent stack-overflow-induced segmentation faults, with the goal of
144
+ making debugging easier. The maximum allowed stack size is controlled
145
+ by the INI directives zend.max_allowed_stack_size, zend.reserved_stack_size,
146
+ and fiber.stack_size.
147
+
115
148
- FFI:
116
149
. FFI::load() is now allowed during preloading when opcache.preload_user is the
117
150
current system user. Previously, calling FFI::load() was not possible during
0 commit comments