-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Closed as not planned
Copy link
Description
Description
I had this issue after upgrading to 8.2 and I've created this example that shows the issue. My php.ini is exactly the production version with one change: browscap points to the latest lite_php_browscap.ini from browscap.org. I'm using IIS on Windows Server 2022.
The following code:
<?php
$string = 'The quick brown fox jumps over the lazy dog.';
$patterns = array();
$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';
$replacements = array();
$replacements[0] = 'slow';
$replacements[1] = 'black';
$replacements[2] = 'bear';
echo preg_replace($patterns, $replacements, $string);
Resulted in this output:
HTTP Error 500.0 - Internal Server Error
But I expected this output instead:
The slow bear jumps over the lazy dog.
In fact, I do get this output if I comment out the browscap setting in php.ini. I also get this result if I remove many lines from the browscap file. I did not see this issue in PHP 8.1.
PHP Version
8.2.13
Operating System
Windows Server 2022