PHP 类型提示
- 简单来说,类型提示是指提供给函数的提示,只接受特定的数据类型。
 - 从技术角度来讲,类型提示是一种强制函数接受特定数据类型的方法。
 - 在PHP中,我们可以使用类型提示来指定对象、数组和可调用数据类型。
 
示例1
<?php
    class a
    {
        public c= "hello javatpoint";
    }
    //create function with class name argument
    function display(aa1)
    {
        //call variable
        echo $a1->c;
    }
    display(new a());
?>
输出:

示例2
<?php
    class Test1
    {
        public var= "hello javatpoint and SSSIT";
    }
    //create function with class name argument
    function typehint(Test1t1)
    {
        //call variable
        echo $t1->var;
    }
    //call function with call name as a argument
    typehint(new Test1());
?>
输出:

极客笔记