Skip to content

Commit 4604065

Browse files
committed
php70: return type hint
1 parent cdda426 commit 4604065

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
function addUser(string $name, int $age, bool $active) : bool
6+
{
7+
return $name; // coz name is string return
8+
}
9+
10+
addUser('First user', 30, true);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
function addUser(string $name, int $age, bool $active) : bool
6+
{
7+
return $active;
8+
}
9+
10+
addUser('First user', 30, true);

0 commit comments

Comments
 (0)