Product Version: NetBeans IDE 7.1 (Build 201112012200)
Java: 1.7.0_147-icedtea; OpenJDK Client VM 21.0-b17
System: Linux version 3.1.0-1-686-pae running on i386; UTF-8; en_US (nb)
User directory: /home/paolo/.netbeans/7.1
Cache directory: /run/netbeans
I noticed that code folding just works for phpdoc comments, functions and classes.
I don't remember if it ever worked but I have the impression that in previous versions it was possible to fold if, else, while, switch and similar.
*** This bug has been marked as a duplicate of bug 186731 ***