<?php
function some_func(){
return 'some_str_type' && 'another_str_type';
}
function another_func(){
return '123' || '456';
}
print some_func(); //1 - the same as true
print another_func(); //again prints 1, as true
The clean style of coding of any language dictates, to drop non-small function into small ones - because one function SHOULD return single value.
BUT, i saw this approach in source of some popular php-template langs (smarty, dwoo). So what is that? When to code this way? (mean any real-world situation)