View Single Post
Old 10-28-2011, 08:19 PM  
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,530
Quote:
Originally Posted by raymor View Post
Yep, $paid = false sets $paid to false.
The warning goes away because it's perfectly legal code, but it's also perfectly useless - it will always be true. To confirm, try this:

$paid = 1;
if ($paid = false) {
echo "oops, wrong answer";
}
Exactly :

<?php

//$paid is not defined yet

if($paid = false) {
echo "paid is false";
}
//$paid was set to false above

if($paid == false) {
echo "That's really FUCKED UP!!!!!!!!!!!!!!!!!!!!!!!!!!!";
}

?>
__________________
Make Money with Porn
blackmonsters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote