User Tools

Site Tools


uphp:functions:isset

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:isset [2017/04/04 14:11]
jeff
uphp:functions:isset [2021/09/13 05:57] (current)
Line 3: Line 3:
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return 1 if the variable exists+Check if variable exists
  
 ====Description==== ====Description====
  
-<well size="sm"><html><span style="font-size:125%;color:green">int +<well size="sm"><html> 
-<span style="color:black"></html>[[isset]] +<span style="font-size:125%;color:green">int 
-<html>(+<span style="color:black">isset (
 <span style="color:green">mixed <span style="color:green">mixed
 <span style="color:blue">$variable <span style="color:blue">$variable
Line 21: Line 21:
 <html><b><span style="color:blue">$variable<span style="color:black"></b></html>:  Variable to check for existence((Multiple parameters are not supported as in mainline PHP)) <html><b><span style="color:blue">$variable<span style="color:black"></b></html>:  Variable to check for existence((Multiple parameters are not supported as in mainline PHP))
  
-====Return Value====+====Return Values====
  
-1 (true) if variable exists, 0 (false) if variable does not exist+<html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 (true) if variable exists, 0 (false) if variable does not exist
  
 ====Examples==== ====Examples====
Line 50: Line 50:
 ====Notes==== ====Notes====
  
-There is no way to unset a variable once it has been set (except to exit the local scope or script where it was defined). Unlike mainline PHP, uPHP does not have a construct ''unset()'' or the constant ''null''. Unlike many other programming languages, you cannot simply remove a variable by setting it equal to nothing, such as by trying the statement ''$x=;''((As tested on a Wattmon Pro with firmware 1.1051 the statement ''$x=;'' causes a Watchdog Timeout error and a reboot of the Wattmon)).+There is no way to unset a variable once it has been set (except to exit the local scope or script where it was defined). Unlike mainline PHP, uPHP does not have a construct ''unset()'' or the constant ''null''. Unlike many other programming languages, you cannot simply remove a variable by setting it equal to nothing, such as by trying the statement ''$x=;''((As tested on a [[hardware:wattmons:WattmonPRO]] with firmware 1.1051 the statement ''$x=;'' causes a Watchdog Timeout error and a reboot of the Wattmon)).
  
 Also note that the uPHP [[isset()]] does not always generate a parsing error if the parameter is not a variable((See http://php.net/manual/en/function.isset.php where it says "Warning: isset() only works with variables as passing anything else will result in a parse error.")). All of these examples will return 0: Also note that the uPHP [[isset()]] does not always generate a parsing error if the parameter is not a variable((See http://php.net/manual/en/function.isset.php where it says "Warning: isset() only works with variables as passing anything else will result in a parse error.")). All of these examples will return 0:
Line 81: Line 81:
 ====See Also==== ====See Also====
  
-[[is_int()]] - Return 1 if the variable is an <html><b><span style="color:green">integer<span style="color:black"></b></html>+[[is_int()]] - Check if variable is an <html><b><span style="color:green">integer<span style="color:black"></b></html>
  
-[[is_float()]] - Return 1 if the variable is a <html><b><span style="color:green">float<span style="color:black"></b></html>+[[is_float()]] - Check if variable is a <html><b><span style="color:green">float<span style="color:black"></b></html>
  
-[[is_numeric()]] - Return 1 if the value is numeric (<html><b><span style="color:green">int<span style="color:black"></b></html>, <html><b><span style="color:green">float<span style="color:black"></b></html> or numeric <html><b><span style="color:green">string<span style="color:black"></b></html>)+[[is_numeric()]] - <html>Check if value is numeric (<b><span style="color:green">int<span style="color:black"></b>, <b><span style="color:green">float<span style="color:black"></b> or numeric <b><span style="color:green">string<span style="color:black"></b>)</html>
  
-[[is_array()]] - Return 1 if the variable is an <html><b><span style="color:green">array<span style="color:black"></b></html>+[[is_array()]] - Check if variable is an <html><b><span style="color:green">array<span style="color:black"></b></html>
  
-[[is_string()]] - Return 1 if the variable is a <html><b><span style="color:green">string<span style="color:black"></b></html>+[[is_string()]] - Check if variable is a <html><b><span style="color:green">string<span style="color:black"></b></html>
  
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/isset.1491315073.txt.gz · Last modified: 2021/09/13 05:56 (external edit)