예제 #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());
   }
 }
예제 #2
0
파일: UnsetTest.java 프로젝트: RoYaLBG/jphp
 @Test
 public void testComplex() {
   Memory memory = includeResource("unset/complex.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #3
0
파일: UnsetTest.java 프로젝트: RoYaLBG/jphp
 @Test
 public void testObjectValue() {
   Memory memory = includeResource("unset/object_value.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #4
0
파일: UnsetTest.java 프로젝트: RoYaLBG/jphp
 @Test
 public void testRefArrayValue() {
   Memory memory = includeResource("unset/ref_array_value.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #5
0
파일: UnsetTest.java 프로젝트: RoYaLBG/jphp
 @Test
 public void testRefInMethodVariables() {
   Memory memory = includeResource("unset/ref_in_method_variables.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #6
0
파일: UnsetTest.java 프로젝트: RoYaLBG/jphp
 @Test
 public void testVariables() {
   Memory memory = includeResource("unset/variables.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #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();
 }
예제 #8
0
 @Test
 public void testIncDec() {
   Memory memory = includeResource("expressions/inc_dec.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #9
0
 @Test
 public void testComplexAssign() {
   Memory memory = includeResource("expressions/complex_assign.php");
   Assert.assertEquals("success", memory.toString());
 }
예제 #10
0
 @Test
 public void testPlusMinusMulDiv() {
   Memory memory = includeResource("expressions/plus_minus_mul_div.php");
   Assert.assertEquals("success", memory.toString());
 }