3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/\b(?: \d{6}[xX*]{2,9}\d{4} # BIN + masked + last4 | (?:\d{4}|[xX*]{4})(?:[ .-]?(?:\d{4}|[xX*]{4})){2,3} # blocs de 4 )\b/x'; $data = '497040726'; preg_match($pattern, $data, $matches); var_dump($matches);
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array(0) { }

preferences:
42.85 ms | 699 KiB | 4 Q