On 16/10/2019 02:46, David Rodrigues wrote:
Hello. I like to suggests a discussion about a FR to make possible to
inline switch, as an alternative to nested inline conditionals.

```
<?php

$value = (function($x) {
        switch ($x) {
                case 1:
                        return 'number 1';
                case 2:
                        return 'number 2';
                default:
                        return 'dunno';
        }
})(1);

echo $value;
```

Depends on how many times you need to call it if this works for you or not.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to