3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $value = '598a'; var_dump( array( preg_replace('/\D+/', '', $value), (int) $value ) );
based on MFQXZ
Output for 4.3.0 - 7.2.0
array(2) { [0]=> string(3) "598" [1]=> int(598) }