title: Fibonacci Modulo P
signature: function fibonacciModuloP($p) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($p, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($p), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        51, 
        36));
      
      printf("TEST-1...%s\n",driver(
        40, 
        30));
      
      printf("TEST-2...%s\n",driver(
        68, 
        18));
      
      printf("TEST-3...%s\n",driver(
        7, 
        8));
      
      printf("TEST-4...%s\n",driver(
        8, 
        6));
      
      printf("TEST-5...%s\n",driver(
        32, 
        24));
      
      printf("TEST-6...%s\n",driver(
        93, 
        60));
      
      printf("TEST-7...%s\n",driver(
        75, 
        100));
      
      printf("TEST-8...%s\n",driver(
        71, 
        70));
      
      printf("TEST-9...%s\n",driver(
        15, 
        20));
      
  }
  
  main();
  ?>
source_py: def fibonacci_modulo_p(p):
      first = 1
      second = 1
      number = 2
      next = 1
      while next:
          next = ((first + second) % p)
          first = second
          second = next
          number = (number + 1)
      return number
source_cpp: int fibonacci_modulo_p(int p) {
    int first = 1, second = 1, number = 2, next = 1;
    while ( next ) {
      next = ( first + second ) % p;
      first = second;
      second = next;
      number ++;
    }
    return number;
  }