Open paales opened 10 years ago
Should all the #
regex delimiters be replaced with ~
?
I'm not sure what the reason was I replaced the errors, I'll have to dig up the error. There was a related stackoverflow question that suggested this solution, but I can't find it anymore.
We have been using HHVM on one of our websites for a week, and we got some warnings that seem to correspond to the same problem, coming from this part of the code :
protected function _getExceptionsListConfig($key)
{
$exceptions = $this->_getSerializedArrayConfig($key);
foreach ($exceptions as $key => $exception) {
// Prepare exceptions patterns
$exceptions[$key] = array(
'block_type' => $this->_prepareExceptionPattern($exception['block_type']),
'rewriting_class_name' => $this->_prepareExceptionPattern($exception['rewriting_class_name']),
);
}
return $exceptions;
}
I don't have read much about HHVM internals yet so I don't really understand what's going on there, but it seems that when using it, the $exceptions
array initially use numeric string keys such as "1"
. The problem here is that it also seems that those keys are turned into integer values when the array is iterated, making all the values be duplicated, and only half of them be valid regexes, later leading to a delimiter error.
This is the only problem (which should easily be fixed) that we got with an everyday use of the extension , but I guess that it will require much more testing to ensure that the extension is fully compatible with HHVM.
More information about preg match what is happening: http://stackoverflow.com/questions/7660545/delimiter-must-not-be-alphanumeric-or-backslash-and-preg-match
We just need another delimiter like ~
as mentioned in the stack overflow answer.
I can't push to te repository and didn't want to maintain a fork. Can you apply the patch below?