Created
October 9, 2020 00:31
-
-
Save vudaltsov/b9fb19d792a92a6219002d5988383692 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @return array<string, mixed> | |
*/ | |
function objectToArray(object $object): array | |
{ | |
return (fn (): array => get_object_vars($this))->call($object); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment