3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = <<<TXT /some text/ TXT; $pattern = "/"; $pattern = preg_quote($pattern, '/'); $matches = array(); $match = preg_match_all("/" . $pattern . "/mi", $text, $matches); var_dump($match, $matches);
Output for 4.3.0 - 7.1.0
int(2) array(1) { [0]=> array(2) { [0]=> string(1) "/" [1]=> string(1) "/" } }