xref: /PHP-8.3/tests/lang/type_hints_002.phpt (revision f8d79582)
1--TEST--
2ZE2 type hinting
3--FILE--
4<?php
5class P { }
6class T {
7    function f(P $p = NULL) {
8        var_dump($p);
9        echo "-\n";
10    }
11}
12
13$o=new T();
14$o->f(new P);
15$o->f();
16$o->f(NULL);
17?>
18--EXPECT--
19object(P)#2 (0) {
20}
21-
22NULL
23-
24NULL
25-
26