3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( '0', '00', '000', '0000', '00000', '000000', '0000000', '00000000'); $id_pattern = "/^\d{7}$/"; foreach($arr as $id){ if(preg_match($id_pattern, $id, $regs)) var_dump($regs); }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { [0]=> string(7) "0000000" }