3 * This file is part of PHPUnit.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * Error handler that converts PHP errors and warnings to exceptions.
14 * @since Class available since Release 4.2.0
16 class PHPUnit_Util_Regex
18 public static function pregMatchSafe($pattern, $subject, $matches = null, $flags = 0, $offset = 0)
20 $handler_terminator = PHPUnit_Util_ErrorHandler::handleErrorOnce(E_WARNING);
21 $match = preg_match($pattern, $subject, $matches, $flags, $offset);
22 $handler_terminator(); // cleaning