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

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

WBOY
WBOYOriginal
2016-12-01 00:25:281186browse

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.

Statement:
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