xref: /PHP-8.3/sapi/fpm/tests/gh12621.phpt (revision 7353c7ce)
1--TEST--
2GH-12621 (browscap segmentation fault when configured with php_admin_value)
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8require_once "tester.inc";
9
10$cfg = <<<EOT
11[global]
12error_log = {{FILE:LOG}}
13[unconfined]
14listen = {{ADDR}}
15pm = dynamic
16pm.max_children = 5
17pm.start_servers = 1
18pm.min_spare_servers = 1
19pm.max_spare_servers = 3
20
21EOT;
22$cfg .= 'php_admin_value[browscap] = ' . __DIR__ . '/../../../ext/standard/tests/misc/browscap.ini';
23
24$code = <<<EOT
25<?php
26\$cv = get_browser("Konqueror/2.0")->browser_name_pattern;
27var_dump(\$cv);
28EOT;
29
30$tester = new FPM\Tester($cfg, $code);
31$tester->start();
32$tester->expectLogStartNotices();
33echo $tester
34    ->request()
35    ->getBody();
36$tester->terminate();
37$tester->close();
38
39?>
40--EXPECT--
41string(14) "*Konqueror/2.*"
42--CLEAN--
43<?php
44require_once "tester.inc";
45FPM\Tester::clean();
46?>
47