3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Things: string { case Such = 'such'; } $string_from_outside_world = 'such'; $outside_world_thing = Things::from($string_from_outside_world); var_dump('such' === Things::Such); var_dump($outside_world_thing === Things::Such);
Output for 8.1.6 - 8.1.34, 8.2.22 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
bool(false) bool(true)

preferences:
63.27 ms | 724 KiB | 4 Q