I think I discovered a problem that seems to be creating a memory leak in Apache / PHP when Unicode characters are delimiters or sometimes somewhere in the regex with preg_matchand preg_replace. Perhaps this happens in more than preg_*methods.
Test case 1
Create a new PHP file test.phpwith the following contents:
<?php
preg_match( '°test°i', 'test', $matches );
Test case 2
Create a new PHP file test.phpwith the following contents:
<?php
preg_match( '°', 'test', $matches );
The unicode character °used as the delimiter is the power sign. Try any other Unicode character to see what happens if you want.
Result
- Apache 2.4.10 (Debian) PHP 5.6.0-1+b1, . " " " ".
Apache error.log(/var/log/error.log):
[Mon Dec 15 10:31:09.941622 2014] [:error] [pid 6292] [client .:64413] PHP Warning: preg_match(): in /path/to/test.php on line 2
[Mon Dec 15 10:31:09.941796 2014] [:error] [pid 6292] [client .:64413] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 139979759686648 bytes) in Unknown on line 0
, , PHP , 127 .
Apache
PHP- script , , . , , , , :
Class MyClass not found in file MyExtendingClass.php on Line 3
MyExtendingClass.php :
<?php
class MyExtendingClass extends MyClass
{
}
, MyClass 2, , PHP .
, Unicode . PHP Unicode? ? , PHP , .
Apache/2.4.10 (Debian) PHP/5.6.0-1 + b1 OpenSSL/1.0.1i