check wordpress version while activating plugin

Some plugins have compatibility issued with various wordpress versions. So if you have to check the current version of wordpress while activating your plugin and also deny installation in some lower wordpress versions you can do this as :

<?php
/*
Plugin Name: myPlugin
Plugin URI: your url address
Description: my first wordpress plugin
WordPress admin interface
Version: 1.0
Author: you naem
Author URI: 
License: GPLv2
*/

register_activation_hook(__FILE__,'firstRunOnActivateFunction');

function firstRunOnActivateFunction() 
{
	global $wp_version; 
	
	// check for wordpress verion 3.5 and lower
	// if the version is lower than 3.5, installation will be denied
	
	If (version_compare($wp_version, "3.5", "<")) 
	{
		deactivate_plugins(basename(__FILE__)); // Deactivate our plugin
		wp_die("This plugin requires WordPress version 3.5 or higher.");
	}
}
?>