Next Sep 23 Previous
Item 547234
Consider this useless program:
<?php class ToggleSwitch { const TOGGLE_STATES = array("on" => true, "off" => false); public $state = false; function __construct() { $this->state = rand(0, 1) ? true : false; } } $switch = new ToggleSwitch(); if ($switch->state === ToggleSwitch::TOGGLE_STATES["on"]) { echo "School's in"; } else { echo "School's out"; } ?>
What will it display in your browser?
A: "School's in"
B: "School's out"
C: "School's in" or "School's out" with an equal probability interval
D: Fatal Error