Files
frankenphp/testdata/worker-getopt.php
Kévin Dunglas 3714fdf3a1 fix: superglobals-realated crash with custom extensions in worker mode (#796)
* test: failing test reproducing #767

* fix

* Update frankenphp.c

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

* Update frankenphp.c

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

* review

* ZVAL_COPY

* fix

* add back current $_SERVER behavior

* add docs

* bad fix for the leak

* clean test

* improve tests

* fix test

* fix

* cleanup

* clarify destroy super globals name

* micro-optim: use zval_ptr_dtor_nogc to destroy super globals

* style

* fix

* better name for frankenphp_free_server_context

* more cleanup

* remove useless memset

* more cleanup

* continue refactoring

* fix and update docs

* docs

---------

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2024-06-05 15:24:16 +02:00

20 lines
334 B
PHP

<?php
do {
$ok = frankenphp_handle_request(function (): void {
print_r($_SERVER);
});
getopt('abc');
if (!isset($_SERVER['HTTP_REQUEST'])) {
exit(1);
}
if (isset($_SERVER['FRANKENPHP_WORKER'])) {
exit(2);
}
if (isset($_SERVER['FOO'])) {
exit(3);
}
} while ($ok);