Back to questions
JuniorTheoryCommon
What does the program print?
<?php
$yes = true;
$no = false;
$nothing = null;
echo '[', $yes, '][', $no, '][', $nothing, "]\n";[1][][]
- Expecting
echoto printtrue,falseandnullby name: it prints each value as a string, which is'1'fortrueand empty for the other two. - Expecting
falseto print as0: as a stringfalseis empty, so a boolean you want to see on the screen goes throughvar_dump.
- How would you print
falseso that it is visible on the screen? - What does
var_dump(true, null);print?