Example #1
0
 @Override
 public Number convert(Environment env, TraceInfo trace, Memory arg) throws Throwable {
   switch (arg.getRealType()) {
     case DOUBLE:
       return arg.toDouble();
     case INT:
       return arg.toInteger();
     default:
       return convert(env, trace, arg.toNumeric());
   }
 }
Example #2
0
 @Test
 public void testComplex() {
   Memory memory = includeResource("unset/complex.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #3
0
 @Test
 public void testObjectValue() {
   Memory memory = includeResource("unset/object_value.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #4
0
 @Test
 public void testRefArrayValue() {
   Memory memory = includeResource("unset/ref_array_value.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #5
0
 @Test
 public void testRefInMethodVariables() {
   Memory memory = includeResource("unset/ref_in_method_variables.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #6
0
 @Test
 public void testVariables() {
   Memory memory = includeResource("unset/variables.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #7
0
 public static String getGivenName(Memory value) {
   if (value.isObject())
     return "an instance of " + value.toValue(ObjectMemory.class).getReflection().getName();
   else return value.getRealType().toString();
 }
Example #8
0
 @Test
 public void testIncDec() {
   Memory memory = includeResource("expressions/inc_dec.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #9
0
 @Test
 public void testComplexAssign() {
   Memory memory = includeResource("expressions/complex_assign.php");
   Assert.assertEquals("success", memory.toString());
 }
Example #10
0
 @Test
 public void testPlusMinusMulDiv() {
   Memory memory = includeResource("expressions/plus_minus_mul_div.php");
   Assert.assertEquals("success", memory.toString());
 }