Function __global->test_password

Definitions

sources/password_rules.php

  • Test password strength.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$password string No No required parameter N/A N/A The password to check
$username string No No Blank (empty string) N/A N/A The username that will go with the password (blank: unknown)
$email_address EMAIL No No Blank (empty string) N/A N/A The e-mail address that will go with the password (blank: unknown)
$dob ?TIME No No Null N/A N/A The date of birth that will go with the password (null: unknown)

Returns

  • Password strength (1-10)
  • Type: integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Test password strength.
 *
 * @param  string $password The password to check
 * @param  string $username The username that will go with the password (blank: unknown)
 * @param  EMAIL $email_address The e-mail address that will go with the password (blank: unknown)
 * @param  ?TIME $dob The date of birth that will go with the password (null: unknown)
 * @return integer Password strength (1-10)
 */

function test_password(string $password, string $username = '', string $email_address = '', ?int $dob = null) : int