comparVer($fossilVer, $target); if($X->status == 'OLD'){ echo 'YES'; }else if($X->status == 'NEW'){ echo 'NO'; } class something{ public $version; public $status; function __construct($target){ $this->version = $target; } function comparVer($fossil, $tar){ $fos = explode('.', $fossil); $t = explode('.', $tar); if(!(count($fos) == count($t))){ die("ERROR!"); }else{ $roop = count($fos); } for($i = 0; $i < $roop; $i++){ if($fos[0] >= $t[0]){ continue; }else{ $this->status = 'NEW'; return; } } $this->status = 'OLD'; } }