3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_password( $length = 8 ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; } for ($i = 0 ; $i < 20 ; $i++) { echo random_password()."\n"; }

preferences:
29.96 ms | 402 KiB | 5 Q