3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $zakres_valid = '@^ST-[0-9]{5,8}$@'; $zakres = array(); $st = 'ST-856549'; for($i=0;$i<10;$i++){ $zakres[] = $st; $st++; } print_r($zakres); for($i=0;$i<10;$i++){ if(!preg_match($zakres_valid, $zakres[$i])){ echo "/".$zakres_valid.", ".$zakres."/"; echo "ERROR. Numer $zakres[$i] z podanego zakresu nie pasuje do wzorca.<br />"; } else { echo "OK"; } } ?>
based on DF8K1
Output for 4.3.0 - 7.1.0
Array ( [0] => ST-856549 [1] => ST-856550 [2] => ST-856551 [3] => ST-856552 [4] => ST-856553 [5] => ST-856554 [6] => ST-856555 [7] => ST-856556 [8] => ST-856557 [9] => ST-856558 ) OKOKOKOKOKOKOKOKOKOK