checking whether a var is empty or not

Pierre-Frédéric Caillaud peufeu at free.fr
Thu Aug 5 11:47:59 EDT 2004


> No, in PHP, you can find out if a variable exists using isset(). And  
> trying
> to dereference an uninitialized variable will generate a warning if you  
> have
> error reporting turned up all the way (error_reporting(E_ALL)).
>

	WRONG !!!!!

	Example in this stupid language :

<?php

	echo "<p>one : ";
	var_dump(isset( $a ));
	
	$a = 1;
	echo "<p>two : ";
	var_dump(isset( $a ));
	
	$a = null;
	echo "<p>three : ";
	var_dump(isset( $a ));

?>

	Output :


one : bool(false)

two : bool(true)

three : bool(false)


	Get it ?






More information about the Python-list mailing list