Skip to content

Commit

Permalink
Merge pull request #3 from certificationy/add-questions-2
Browse files Browse the repository at this point in the history
Added more questions
  • Loading branch information
mickaelandrieu committed Mar 16, 2015
2 parents 4eb6c96 + 4e9e33a commit 524e065
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion data/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,24 @@ questions:
- {value: '$stderr = stderr("w")', correct: false}
- {value: '$stderr = fwrite("php://stderr");', correct: true)}


question: |
What would you replace ??????? with, below, to make the string Hello, World! be displayed?
function myfunction() {
/* ??????? */
print $string;
}
myfunction("Hello, World!");
answers:
- {value: 'There is no way to do this.', correct: false}
- {value: '$string = $argv[1];', correct: false}
- {value: '$string = $_ARGV[0];', correct: false}
- {value: 'list($string) = func_get_args();', correct: true}
- {value: '$string = get_function_args();', correct: false}
-
question: 'For an arbitrary string $mystring, which of the following checks will correctly determine if the string PHP exists within it?'
answers:
- {value: 'if(strpos($mystring, "PHP") !== false)', correct: true}
- {value: 'if(!strpos($mystring, "PHP))', correct: false}
- {value: 'if(strpos($mystring, "PHP") === true', correct: false}
- {value: 'if(strloc($mystring, "PHP") == true', correct: false}
- {value: 'if(strloc($mystring, "PHP") === false)', correct: false}

0 comments on commit 524e065

Please sign in to comment.