add gettype PHP

This commit is contained in:
Alexander Popov 2021-12-03 03:25:08 +03:00
parent 91b6aca548
commit 64f95bd183
Signed by: iiiypuk
GPG Key ID: 398FC73478D97286
2 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,4 @@
# PHP
## ...
## std
- [`gettype`](gettype.php) - Get the type of a variable

18
PHP/gettype.php Normal file
View File

@ -0,0 +1,18 @@
<?php
// gettype(mixed $value): string
$value = 1;
// Return Values
// Possible values for the returned string are:
//
// "boolean"
// "integer"
// "double" (for historical reasons "double" is returned in case of a float, and not simply "float")
// "string"
// "array"
// "object"
// "resource"
// "resource (closed)" as of PHP 7.2.0
// "NULL"
// "unknown type"
?>