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