I think the first approach has a better performance.

```
<?php if(cond) { $var = 'v1'; } else { $var = 'v2'; } ?>

```

or

```
<?php $var = (cond)?'v1':'v2'; ?>

```

thanks.

EDIT: i mean about server performance like wasting less ram ...