3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pattern = '/^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d])(?=.*[\W]).*$/i'; $sample = 'Pderas12!'; echo (int)preg_match( $pattern, $sample, $matches).PHP_EOL; print_r($matches);
based on 7HurJ
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
1 Array ( [0] => Pderas12! )
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/CFb4c on line 4 1PHP_EOLArray ( [0] => Pderas12! )