本文整理了Java中php.runtime.Memory.isImmutable()
方法的一些代码示例,展示了Memory.isImmutable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Memory.isImmutable()
方法的具体详情如下:
包路径:php.runtime.Memory
类名称:Memory
方法名:isImmutable
暂无
代码示例来源:origin: jphp-group/jphp
public static void checkYieldReference(Memory memory, Environment env, TraceInfo trace) {
if (memory.isImmutable()) {
env.error(trace, ErrorType.E_NOTICE, Messages.ERR_YIELD_NOT_REFERENCE.fetch());
}
}
}
代码示例来源:origin: jphp-group/jphp
public static void checkReturnReference(Memory memory, Environment env, TraceInfo trace) {
if (memory.isImmutable() && !memory.isUndefined()) {
env.warning(trace, Messages.ERR_RETURN_NOT_REFERENCE.fetch());
}
}
代码示例来源:origin: jphp-group/jphp
@Test
public void testValueOf(){
Memory memory = ReferenceMemory.valueOf(Memory.TRUE);
Assert.assertTrue(memory instanceof ReferenceMemory);
Assert.assertFalse(memory.isImmutable());
Assert.assertNotNull(memory.toImmutable());
Assert.assertTrue(memory.toImmutable().isImmutable());
Assert.assertTrue(memory.toImmutable() instanceof TrueMemory);
}
代码示例来源:origin: jphp-group/jphp
@Test
public void testFalse(){
Memory memory = Memory.FALSE;
Assert.assertEquals(Memory.Type.BOOL, memory.type);
Assert.assertFalse(memory.toBoolean());
Assert.assertEquals("", memory.toString());
Assert.assertEquals(0.0, memory.toDouble(), 0.000001);
Assert.assertEquals(0, memory.toLong());
Assert.assertNotNull(memory.toNumeric());
Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);
Assert.assertEquals(0, memory.toNumeric().toLong());
Assert.assertEquals(memory, memory.toImmutable());
Assert.assertTrue(memory.isImmutable());
}
代码示例来源:origin: jphp-group/jphp
@Test
public void testTrue(){
Memory memory = Memory.TRUE;
Assert.assertEquals(Memory.Type.BOOL, memory.type);
Assert.assertTrue(memory.toBoolean());
Assert.assertEquals("1", memory.toString());
Assert.assertEquals(1.0, memory.toDouble(), 0.000001);
Assert.assertEquals(1, memory.toLong());
Assert.assertNotNull(memory.toNumeric());
Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);
Assert.assertEquals(1, memory.toNumeric().toLong());
Assert.assertEquals(memory, memory.toImmutable());
Assert.assertTrue(memory.isImmutable());
}
代码示例来源:origin: jphp-group/jphp
@Test
public void testNull(){
Memory memory = Memory.NULL;
Assert.assertEquals(Memory.Type.NULL, memory.type);
Assert.assertFalse(memory.toBoolean());
Assert.assertEquals("", memory.toString());
Assert.assertEquals(0.0, memory.toDouble(), 0.000001);
Assert.assertEquals(0, memory.toLong());
Assert.assertNotNull(memory.toNumeric());
Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);
Assert.assertEquals(0, memory.toNumeric().toLong());
Assert.assertEquals(memory, memory.toImmutable());
Assert.assertTrue(memory.isImmutable());
}
内容来源于网络,如有侵权,请联系作者删除!