note 129640 added to backedenum.from

From: Date: Sat, 06 Jul 2024 15:11:57 +0000
Subject: note 129640 added to backedenum.from
Groups: php.notes 
Request: Send a blank email to php-notes+get-221412@lists.php.net to get a copy of this message
Note that the from method also can be called from a defined enum to get another value: <?php enum Foo: int { case A = 1; case B = 2; } $e1 = Foo::A; $e2 = $e1->from(2); echo $e1->value . PHP_EOL; echo $e2->value . PHP_EOL; // prints: // 1 // 2 ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 181.228.94.44) ---- Manual Page -- https://php.net/manual/en/backedenum.from.php Edit -- https://main.php.net/note/edit/129640 Del: integrated -- https://main.php.net/note/delete/129640/integrated Del: useless -- https://main.php.net/note/delete/129640/useless Del: bad code -- https://main.php.net/note/delete/129640/bad+code Del: spam -- https://main.php.net/note/delete/129640/spam Del: non-english -- https://main.php.net/note/delete/129640/non-english Del: in docs -- https://main.php.net/note/delete/129640/in+docs Del: other reasons-- https://main.php.net/note/delete/129640 Reject -- https://main.php.net/note/reject/129640 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221412) next »