optimized contains method of Php::Value