: This article describes how to use the arrayAccess interface. if you are interested in the PHP Tutorial, refer to it.
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 '];
The above describes the use of arrayAccess interfaces, including the content, and hope to be helpful to friends who are interested in PHP tutorials.