I create a simple script for search words inside a txt file.
<?php
$search_term = "lorem";
$file = file('textfile.txt');
foreach($file as $line_number => $line){
$row = preg_match('/' . $search_term . '/i', $line);
echo $row;
}
The TXT file have > 7000 lines, in total ~ 6 MB
In php 5.6, 7.0 or 7.1 the script runs in 60 - 100 ms., but in php >= 7.2 the time of execution up to 3.5 seconds.
I compare the php.ini files for each versión and I dont see any diference for PCRE options.
Can anyone help me?
Thanks in advance.
stripos?