3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_password( $length = 8 ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; } echo generate_password(6); ?>

preferences:
35.67 ms | 402 KiB | 5 Q