- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$string = '--';
$doesNotMatchInPhp7 = '/(?|(---)|(-))\1/';
$matchesInPhp7 = '/(?|(-)|(---))\1/';
var_dump(preg_match($doesNotMatchInPhp7, $string));
var_dump(preg_match($matchesInPhp7, $string));