Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationis_set

is_set (mixed variable) ⇒ boolean

Determines if a variable has already been defined locally, globally or as a parameter. This is particularly useful for determining if an optional parameter has been defined.

First available: Version 1.3.1

Using is_set

The is_set function is one of the oldest functions in ZPE and has existed since one of the first versions. It's underlying implementation has remained somewhat the same throughout the development until about version 1.5.x where it had a major overhaul.

It is a very powerful function with one of the most unique capabilities of all predefined functions because it has the ability to assess unevaluated variables.

The function can be used to check if an index of a value exists too, so this can be used to check the arguments of a program:

YASS
print(is_set($args[0]))
    

The is_set function can also be used on pure values:

YASS
print(is_set(10))
    

The result when applied to a value will always yield true.

Comments
Feedback 👍
Comments are sent via email to me.