1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/traits/bugs/missing-trait.phpt
Ilija Tovilo 8731c95b35 Make missing trait error recoverable
We were already handling NULL as a case, but seem to have forgotten to
pass the ZEND_FETCH_CLASS_EXCEPTION flag.

Also make "is not a trait" error recoverable, there's no reason why it
can't be.

Fixes GH-17959
Closes GH-17960
2025-03-12 16:19:58 +01:00

19 lines
278 B
PHP

--TEST--
Check error message for missing traits
--FILE--
<?php
error_reporting(E_ALL);
class TraitsTest {
use THello;
}
$test = new TraitsTest();
?>
--EXPECTF--
Fatal error: Uncaught Error: Trait "THello" not found in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d