What is the output of the following code? class Foo Implements ArrayAccess { function offsetExists($k) { return true;} function offsetGet($k) {return ‘a’;} function offsetSet($k, $v) {} function offsetUnset($k) {} } $x = new Foo(); echo array_key_exists(‘foo’, $x)?’true’:’false’; A. true B.…

What is the output of the following code? class Bar { private $a = ‘b’; public $c = ‘d’; } $x = (array) new Bar(); echo array_key_exists(‘a’, $x) ? ‘true’ : ‘false’; echo ‘-‘; echo array_key_exists(‘c’, $x) ? ‘true’ :…

What is the output of the following code? $a = array(‘a’, ‘b’=>’c’); echo property_exists((object) $a, ‘a’)?’true’:’false’; echo ‘-‘; echo property_exists((object) $a, ‘b’)?’true’:’false’; A. false-false B. false-true C. true-false D. true-true