1--TEST--
2GH-9905 (constant() behaves inconsistent when class is undefined)
3--FILE--
4<?php
5try {
6 \constant("\NonExistantClass::non_existant_constant");
7} catch (\Throwable|\Error|\Exception $e) {
8 echo($e->getMessage());
9}
10?>
11--EXPECT--
12Class "NonExistantClass" not found
13