You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== sequals ==
[[../../Optimizer#CACHE_RETURN|CACHE_RETURN]] |} === Usages ===
Copy Code
The output would be:
Copy Code
The output would be:
Copy Code
The output would be:
Uses a strict equals check, which determines if two values are not only equal, but also the same type. So, while equals('1', 1) returns true, sequals('1', 1) returns false, because the first one is a string, and the second one is an int. More often than not, you want to use plain equals(). In addition, type juggling is explicitly not performed on strings. Thus '2' !== '2.0', despite those being ==. Operator syntax is also supported: @a === @b
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| sequals
|-
! scope="row" | Returns
| boolean
|-
! scope="row" | Usages
| val1, val2
|-
! scope="row" | Throws
|
|-
! scope="row" | Since
| 3.3.0
|-
! scope="row" | Restricted
| No
|-
! scope="row" | Optimizations
| [[../../Optimizer#CONSTANT_OFFLINE|CONSTANT_OFFLINE]] [[../../Optimizer#CACHE_RETURN|CACHE_RETURN]] |} === Usages ===
sequals(val1, val2)=== Examples === ====Example 1==== Functional usage Given the following code:
sequals('1', 1)
Copy Code1 {{function|sequals}}('1', 1)
:false====Example 2==== Symbolic usage Given the following code:
'1' === 1
Copy Code1 '1' === 1
:false====Example 3==== Symbolic usage Given the following code:
'1' === '1'
Copy Code1 '1' === '1'
:true===See Also===
[[API/functions/equals.html|equals]], [[API/functions/nequals.html|nequals]], [[API/functions/snequals.html|snequals]]Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)