return true, with comment stating a return false... - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8) +--- Thread: return true, with comment stating a return false... (/showthread.php?tid=1170) |
return true, with comment stating a return false... - Knitter - 2010-12-10 Ok, not exactly as the title implies, just wanted to get some of your attention Function get_parent() states that it echoes a page's parent slug as a String. The problem is that the $parent var is an object, so if I just want the echo for that object PHP will call the __toString method but if I want the function to return the slug I get an object instead of a string. For example: get_parent() will echo the parent's slug. get_parent(false) will return an object. The behavior doesn't match the documentation and I think that it should really return a String and not an object. I noticed this when doing a simple if(get_parent(false)), which is always true, even if the page has no parent. |