3v4l.org

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

preferences:
34.85 ms | 402 KiB | 5 Q