Skip to content

Commit cdda426

Browse files
committed
php70: scalar type hint
1 parent 75c8cce commit cdda426

File tree

2 files changed

+24
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)