xref: /PHP-8.4/tests/lang/type_hints_002.phpt (revision 2079da01)
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--EXPECTF--
19Deprecated: T::f(): Implicitly marking parameter $p as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
20object(P)#2 (0) {
21}
22-
23NULL
24-
25NULL
26-
27