prototype_obj_properties = array_combine( self::$prototype_properties, array_fill( 0, count(self::$prototype_properties), null ) ); } } public function __call( $method, $args = array() ) { if ( isset( self::$prototype_methods[$method] ) ) { array_push( $args, $this ); return call_user_func_array( self::$prototype_methods[$method], $args ); } } public function __get( $name ) { if ( in_array( $name, self::$prototype_properties ) ) { return isset( $this->prototype_obj_properties[$name] ) ? $this->prototype_obj_properties[$name] : null; } else { return null; } } public function __set( $name, $value ) { if ( in_array( $name, self::$prototype_properties ) ) { return $this->prototype_obj_properties[$name] = $value; } else { return null; } } public function __isset( $name ) { return isset( $this->prototype_obj_properties[$name] ); } public function __unset( $name ) { unset( $this->prototype_obj_properties[$name] ); } } class Person extends Prototype { public $name; public $gender; function gender() { echo "$this->name is $this->gender\n"; } } ?>