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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -