ArrayAccess interface. What is the arrayAccess interface? PhpgetthemethodsinstanceofArrayAccessgetthepropertiesinstanceofArrayAccess $ reflectionnewReflectionClass (Arra arrayAccess interface)
GetMethods (); // var_dump ($ reflection-> getProperties (); class dbTypes implements ArrayAccess {private $ dbtypes = array (); // determine whether there is a public function offsetExists ($ offset) {return isset ($ this-> dbtypes [$ offset])? True: false;} // Obtain the public function offsetGet ($ offset) {if ($ this-> offsetExists ($ offset )) {return $ this-> dbtypes [$ offset];} else {return null ;}// set a public function offsetSet ($ offset, $ value) {$ this-> dbtypes [$ offset] = $ value;} // delete a public function offsetUnset ($ offset) {unset ($ this-> dbtypes [$ offset]); }}$ types = new dbTypes (); echo $ types ['nosql '];
Why? Php // get the methods instance of ArrayAccess // get the properties instance of ArrayAccess $ reflection = new ReflectionClass ('arra...