instaclick / php-webdriver

W3C and Selenium 2 webdriver "thin client" for php 5.3+ and namespaces.
Other
436 stars 62 forks source link

preg_replace() requires quoting, specially for PHP 7.3 #91

Closed stronk7 closed 5 years ago

stronk7 commented 5 years ago

Without this, a number of expressions fail (returning NULL), leading to both non matches and warning/error:

Warning: preg_replace(): Compilation failed: number too big in {} quantifier at offset 6

This is specially noticeable under PHP 7.3, where the new PCRE2 engine is more picky and has more features, but also may help some cases with previous PHP versions, depending of the string being searched/replaced

stronk7 commented 5 years ago

Here there is a simple script showing the error and the fix applied, for better understanding:

https://3v4l.org/DgDZZ

Ciao :-)