|
99 | 99 | <entry><constant>INI_ALL</constant></entry>
|
100 | 100 | <entry></entry>
|
101 | 101 | </row>
|
| 102 | + <row> |
| 103 | + <entry><link linkend="ini.zend.max-allowed-stack-size">zend.max_allowed_stack_size</link></entry> |
| 104 | + <entry>"0"</entry> |
| 105 | + <entry><constant>INI_SYSTEM</constant></entry> |
| 106 | + <entry>Available as of PHP 8.3.0.</entry> |
| 107 | + </row> |
| 108 | + <row> |
| 109 | + <entry><link linkend="ini.zend.reserved-stack-size">zend.reserved_stack_size</link></entry> |
| 110 | + <entry>"0"</entry> |
| 111 | + <entry><constant>INI_SYSTEM</constant></entry> |
| 112 | + <entry>Available as of PHP 8.3.0.</entry> |
| 113 | + </row> |
| 114 | + <row> |
| 115 | + <entry><link linkend="ini.fiber.stack-size">fiber.stack_size</link></entry> |
| 116 | + <entry></entry> |
| 117 | + <entry><constant>INI_ALL</constant></entry> |
| 118 | + <entry>Available as of PHP 8.1.0.</entry> |
| 119 | + </row> |
102 | 120 | </tbody>
|
103 | 121 | </tgroup>
|
104 | 122 | </table>
|
|
304 | 322 | </listitem>
|
305 | 323 | </varlistentry>
|
306 | 324 |
|
| 325 | + <varlistentry xml:id="ini.zend.max-allowed-stack-size"> |
| 326 | + <term> |
| 327 | + <parameter>zend.max_allowed_stack_size</parameter> |
| 328 | + <type>int</type> |
| 329 | + </term> |
| 330 | + <listitem> |
| 331 | + <para> |
| 332 | + The maximum native stack space that the operating system allows the |
| 333 | + program to consume. |
| 334 | + Trying to consume more than the operating system allows |
| 335 | + typically results in a hard crash with no easily available debugging |
| 336 | + information. |
| 337 | + To make debugging easier, the engine throws an |
| 338 | + <classname>Error</classname> |
| 339 | + before it happens (when the program uses more than |
| 340 | + <link linkend="ini.zend.max-allowed-stack-size">zend.max_allowed_stack_size</link>-<link linkend="ini.zend.reserved-stack-size">zend.reserved_stack_size</link> |
| 341 | + bytes of stack). |
| 342 | + </para> |
| 343 | + <para> |
| 344 | + Recursion in user-defined code does not consume native stack space. |
| 345 | + However, internal functions and magic methods do. |
| 346 | + Very deep recursion involving these functions can cause the program to |
| 347 | + exhaust all available native stack space. |
| 348 | + </para> |
| 349 | + <para> |
| 350 | + Possible values for this parameter are: |
| 351 | + <simplelist> |
| 352 | + <member> |
| 353 | + <literal>0</literal>: |
| 354 | + Auto-detect the maximum native stack space that the operating system |
| 355 | + allows the program to consume. |
| 356 | + This is the default. |
| 357 | + When detection is not possible, a known system default is used. |
| 358 | + </member> |
| 359 | + <member> |
| 360 | + <literal>-1</literal>: Disables stack size checking in the engine. |
| 361 | + </member> |
| 362 | + <member> |
| 363 | + Positive integer: A fixed size, in bytes. |
| 364 | + Setting this value too high has the same effect as disabling stack size |
| 365 | + checking. |
| 366 | + </member> |
| 367 | + </simplelist> |
| 368 | + </para> |
| 369 | + <para> |
| 370 | + As the stack size of |
| 371 | + <link linkend="language.fibers">fibers</link> |
| 372 | + is determined by |
| 373 | + <link linkend="ini.fiber.stack-size">fiber.stack_size</link>, |
| 374 | + the value of this parameter is used instead of |
| 375 | + <link linkend="ini.zend.max-allowed-stack-size">zend.max_allowed_stack_size</link> |
| 376 | + when checking stack usage during the execution of a Fiber. |
| 377 | + </para> |
| 378 | + <note> |
| 379 | + <para> |
| 380 | + This is not related to stack <emphasis>buffer</emphasis> overflows, and is not a security |
| 381 | + feature. |
| 382 | + </para> |
| 383 | + </note> |
| 384 | + </listitem> |
| 385 | + </varlistentry> |
| 386 | + |
| 387 | + <varlistentry xml:id="ini.zend.reserved-stack-size"> |
| 388 | + <term> |
| 389 | + <parameter>zend.reserved_stack_size</parameter> |
| 390 | + <type>int</type> |
| 391 | + </term> |
| 392 | + <listitem> |
| 393 | + <para> |
| 394 | + The reserved stack size, in bytes. |
| 395 | + This is subtracted from the |
| 396 | + <link linkend="ini.zend.max-allowed-stack-size">max allowed stack size</link>, |
| 397 | + as a buffer, when checking the stack size. |
| 398 | + </para> |
| 399 | + <para> |
| 400 | + Possible values for this parameter are: |
| 401 | + <simplelist> |
| 402 | + <member> |
| 403 | + <literal>0</literal>: Auto-detect a sensible size. |
| 404 | + </member> |
| 405 | + <member> |
| 406 | + Positive integer: A fixed size, in bytes. |
| 407 | + </member> |
| 408 | + </simplelist> |
| 409 | + </para> |
| 410 | + </listitem> |
| 411 | + </varlistentry> |
| 412 | + |
| 413 | + <varlistentry xml:id="ini.fiber.stack-size"> |
| 414 | + <term> |
| 415 | + <parameter>fiber.stack_size</parameter> |
| 416 | + <type>int</type> |
| 417 | + </term> |
| 418 | + <listitem> |
| 419 | + <para> |
| 420 | + The native stack size, in bytes, allocated for each |
| 421 | + <link linkend="language.fibers">Fiber</link>. |
| 422 | + </para> |
| 423 | + <para> |
| 424 | + The default value is 1MiB on systems with a pointer size lower than |
| 425 | + 8 bytes, or 2MiB otherwise. |
| 426 | + </para> |
| 427 | + </listitem> |
| 428 | + </varlistentry> |
307 | 429 | </variablelist>
|
308 | 430 | </para>
|
309 | 431 | </section>
|
|
0 commit comments