summaryrefslogtreecommitdiff
path: root/tests/classes/autoload_009.phpt
blob: 6903d9d8ba57f85d576d0c8ed9a89b05e4a29c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
Ensure type hints for unknown types do not trigger autoload.
--FILE--
<?php
spl_autoload_register(function ($name) {
  echo "In autoload: ";
  var_dump($name);
});

function f(UndefClass $x)
{
}
f(new stdClass);
?>
--EXPECTF--
Fatal error: Uncaught TypeError: f(): Argument #1 ($x) must be of type UndefClass, stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): f(Object(stdClass))
#1 {main}
  thrown in %s on line %d