🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #219917

!isset - zbędna negacja?

#219917
From: hazet
Date: Thu, 30 Jul 2009 13:01
29 lines
1404 bytes
Jest taki kod:

if(!isset($_GET['styl']))
  	{
  		require('./normalny.php');
  	}
  	else
  	{
  		require('./opcjonalny.php');
  	}

Jeśli zmienna styl "nie" istnieje require normalny w innym wypadku 
opcjonalny.

Po co ta negacja ?
Przecież równie dobrze można:

if(isset($_GET['styl']))
  	{
		require('./opcjonalny.php');
  	}
  	else
  	{
  		require('./normalny.php');
  	}

Jeśli zmienna styl istnieje require opcjonalny w innym wypadku normalny.
Trochę mnie to zastanawia, widziałem to w wielu kodach i ta negacja 
wydaje się być bez sensu.
Technical Details
Message-ID: <h4s5jk$1rf$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: hazet <hazet@no-mail.pl>
Newsgroups: pl.comp.lang.php
Subject: !isset - zbędna negacja?
Date: Thu, 30 Jul 2009 15:01:42 +0200
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 29
Message-ID: <h4s5jk$1rf$1@inews.gazeta.pl>
NNTP-Posting-Host: static-ip-77-89-75-190.promax.media.pl
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1248958900 1903 77.89.75.190 (30 Jul 2009 13:01:40 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Thu, 30 Jul 2009 13:01:40 +0000 (UTC)
X-User: vitar91
X-Antivirus: avast! (VPS 090729-1, 2009-07-29), Outbound message
X-Antivirus-Status: Clean
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit