Which these conditional has a better performance in php? -
i think first approach has better performance.
<?php if(cond) { $var = 'v1'; } else { $var = 'v2'; } ?> or
<?php $var = (cond)?'v1':'v2'; ?> thanks.
edit: mean server performance wasting less ram ...
no performance difference. readability issues. stop giving importance such tiny details , focus on bigger picture!
Comments
Post a Comment