Home > Backend Development > PHP Tutorial > Regular expression - PHP regular replacement preg_replace will crash the program?

Regular expression - PHP regular replacement preg_replace will crash the program?

WBOY
Release: 2023-03-01 16:04:01
Original
1209 people have browsed it

php5.6.15

I wrote a SQL batch insert into the database. It is very long. When using preg_replace to filter the SQL, the program will crash. There is no error record. There is an error in php5ts.dll in the system log. If my sql is shorter, it will be fine.

Even if the traceback limit is exceeded, shouldn’t it return failure? How could it collapse?

Has anyone encountered this? what happened?

Reply content:

php5.6.15

I wrote a SQL for batch insertion into the database. It is very long. When using preg_replace to filter the SQL, the program will crash. There is no error record. There is an error in php5ts.dll in the system log. If my sql is shorter, it will be fine.

Even if the traceback limit is exceeded, shouldn’t it return failure? How could it collapse?

Has anyone encountered this? what happened?

I have tested before. Writing more than 7,000 pieces of the simplest data in batches at one time will be too long. Just insert it in multiple times.

I don’t know if you are inserting and replacing at the same time or if you are replacing and inserting at the same time, you should separate the two! Then log it to see where the problem occurred.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template