-1

On this site: http://php.net/manual/de/function.is-int.php

there's a function that checks if a value is an integer.

The function:

is_int ( mixed $var ) : bool

What does the ": bool" do exactly?

Tom
  • 27
  • 4
  • 1
    http://php.net/manual/en/language.types.boolean.php – executable Jan 11 '19 at 08:57
  • @executable Not really helpful here. – deceze Jan 11 '19 at 08:58
  • 1
    [Return type declarations](https://secure.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) – simon Jan 11 '19 at 08:58
  • The return value of the function will be a boolean. – Kwun Yeung Jan 11 '19 at 09:01
  • just means that the function will return a boolean value. – Stender Jan 11 '19 at 09:01
  • :bool there means the return type. That is how they are represented in the the documentation. `echo is_int (1)` will return true while `echo is_int (1.55) ` will return false or no value. – comphonia Jan 11 '19 at 09:02
  • Note https://stackoverflow.com/q/24386569/476: the return type used to be on the left side of the signature; looks like they've switched it to correspond to the official type hinting syntax. – deceze Jan 11 '19 at 09:04

1 Answers1

1

The function returns a value of bool type.

Bool can be true or false.

ebug38
  • 151
  • 1
  • 10