Developer's Guide
7. $a = 17 + 23; // A comment inside my exemple function
8. Outside funcions and methods, only the "/" and "/" comment tags
are allowed
9.
10. /* This method is required for compatibility issues */
11. public function foo()
12. {
13. // Some code explanation right here
14. [...]
15. }
16. PHP Doc Element comment is required before the method
declarations
17.
18. /**
19. * Return field value if possible (both classical and multilingual
fields)
20. *
21. * Case 1 : Return value if present in $_POST / $_GET
22. * Case 2 : Return object value
23. *
24. * @param object $obj Object
25. * @param string $key Field name
26. * @param integer $id_lang Language id (optional)
27. * @return string
28. */
29. protected function getFieldValue($obj, $key, $id_lang = NULL)
For more informations
For more informations about the PHP Doc norm:
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.pkg.html
Return values
1. Return statement does not need brackets except when it deals with
a composed
expression
2.
3. return $result;
4. return ($a + $b);
5. return (a() - b());
6. return true;
7. Break a function
8.
9. return;
Call
Function call preceded by a "@" is forbidden but beware with function /
method call with login / password or path argmuments.
myfunction()
// In the following exemple we put a @ for security reasons
@mysql_connect([...]);