Recent Notes

Displaying keyword search results 1 - 5
Created by jinx on April 29, 2011 15:03:10    Last update: April 29, 2011 15:04:02
The PHP function is_callable verifies that a variable can be invoked as a function. Example: <?php define('F', 'f'); function... Output: var_dump: string(1) "f" is_callable: 1 Calla...
Created by jinx on April 26, 2011 21:52:10    Last update: April 26, 2011 21:52:10
PHP offers several ways to check the class type of an object instance at runtime: instanceof operator, is_a function, get_class function. Example: <?php class A { } class B { } ...
Created by jinx on April 25, 2011 12:43:40    Last update: April 25, 2011 12:43:40
Use the PHP function method_exists to check if the class or object has a certain method. It returns TRUE if the method exists (even when the value of the property is NULL), FALSE if the method does not exist. Example: <?php class A { var $p = 'A property'; ... Outputs: Class A has method f1: bool(true) Object $a has... Also note that C++-like method overloading does not exist in PHP. Thus there's no ambiguity about which version of the method exists, i.e., with no argument, with one argument... etc. The following code generates Fatal error: <?php class A { var $p = 'A property'; ...
Created by jinx on April 25, 2011 11:50:09    Last update: April 25, 2011 11:51:53
Use the PHP function property_exists to check if the class or object has a certain property. It returns TRUE if the property exists (even when the value of the property is NULL), FALSE if the property does not exist, or NULL in case of an error. Example: <?php class A { var $p = 'A property'; ... Outputs: Class A has property $p: bool(false) Class A ha...
Created by Fang on March 30, 2011 15:31:24    Last update: March 30, 2011 15:31:24
You get this error when you are trying to compile with JDK 1.5 (class version 49), but your dependency was compiled by JDK 1.6 (class version 50). Check the JAVA_HOME setting, and make sure it's pointing to JDK 1.6. On Unix, use set | grep -i java_home On Windows, just set JAVA_HOME