php-src/Zend/tests/gh10346.phpt
Bob Weinand a6a20c9e17 Add regression test for e560592a61
Reproduces only under ASAN.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-01-17 11:14:00 +01:00

30 lines
491 B
PHP

--TEST--
GH-10346 (Observer: enum tryFrom() run_time_cache properly assigned)
--CREDITS--
Florian Sowade
--EXTENSIONS--
zend_test
--INI--
zend_test.observer.enabled=1
zend_test.observer.observe_all=1
--FILE--
<?php
enum Card : string
{
case HEART = 'H';
}
var_dump(Card::tryFrom('H'));
?>
--EXPECTF--
<!-- init '%s' -->
<file '%s'>
<!-- init Card::tryFrom() -->
<Card::tryFrom>
</Card::tryFrom>
<!-- init var_dump() -->
<var_dump>
enum(Card::HEART)
</var_dump>
</file '%s'>