3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedAttachmentTypes = '.jpeg,.gif,.png,.jpg,.bmp'; $allowedAttachmentTypes = array_filter( explode( ',', $allowedAttachmentTypes ), function( $var ) { return preg_replace( '#[\s\.]+#', '', $var ); } ); print_r( $allowedAttachmentTypes );

preferences:
42.5 ms | 402 KiB | 5 Q