- 移除编译器中无用的原生函数检查逻辑 - 更新反射参数检查以支持类方法参数引用 - 添加类型化对象的方法调用处理机制 - 实现匿名类实例继承相关功能 - 修复数组元素递增递减操作处理 - 优化ZipArchive等扩展函数的引用参数处理 - 添加私有属性名称解混淆测试用例 - 扩展反射类以支持类方法参数获取pull/1/head
parent
a1d74df985
commit
257616d571
7 changed files with 154 additions and 20 deletions
@ -0,0 +1,18 @@ |
|||||||
|
--TEST-- |
||||||
|
array item inc/dec |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
function main() |
||||||
|
{ |
||||||
|
$array = array(1000); |
||||||
|
var_dump($array[0]); |
||||||
|
$array[0]--; |
||||||
|
var_dump($array[0]); |
||||||
|
$array[0]++; |
||||||
|
var_dump($array[0]); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(1000) |
||||||
|
int(999) |
||||||
|
int(1000) |
||||||
@ -0,0 +1,42 @@ |
|||||||
|
--TEST-- |
||||||
|
ref call arg |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
function main() |
||||||
|
{ |
||||||
|
$zip = new ZipArchive(); |
||||||
|
if ($zip->open(__DIR__ . '/../../examples/test.zip') === TRUE) { |
||||||
|
for ($idx = 0; $s = $zip->statIndex($idx); $idx++) { |
||||||
|
$rs = $zip->getExternalAttributesIndex($idx, $opsys, $attr); |
||||||
|
var_dump($rs, $idx, $opsys, $attr); |
||||||
|
} |
||||||
|
$zip->close(); |
||||||
|
echo "OK\n"; |
||||||
|
} |
||||||
|
|
||||||
|
$str = "first=value&arr[]=foo+bar&arr[]=baz"; |
||||||
|
parse_str($str, $output); |
||||||
|
echo $output['first'], PHP_EOL; // value |
||||||
|
echo $output['arr'][0], PHP_EOL; // foo bar |
||||||
|
echo $output['arr'][1], PHP_EOL; // baz |
||||||
|
echo "DONE\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
bool(true) |
||||||
|
int(0) |
||||||
|
int(3) |
||||||
|
int(1107099648) |
||||||
|
bool(true) |
||||||
|
int(1) |
||||||
|
int(3) |
||||||
|
int(2176057344) |
||||||
|
bool(true) |
||||||
|
int(2) |
||||||
|
int(3) |
||||||
|
int(2176057344) |
||||||
|
OK |
||||||
|
value |
||||||
|
foo bar |
||||||
|
baz |
||||||
|
DONE |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
--TEST-- |
||||||
|
Ensure proper inheritance with get_class(anon class instance) used via class_alias (see also bug #70106) |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
function main() { |
||||||
|
class_alias(get_class(new class { protected $foo = 1; }), "AnonBase"); |
||||||
|
var_dump((new class extends AnonBase { |
||||||
|
function getFoo() { |
||||||
|
return $this->foo; |
||||||
|
} |
||||||
|
})->getFoo()); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(1) |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
--TEST-- |
||||||
|
Ensure correct unmangling of private property names for anonymous class instances |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
var_dump(new class { private $foo; }); |
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
object(_anon_class_%s)#1 (1) { |
||||||
|
["foo":"_anon_class_%s":private]=> |
||||||
|
NULL |
||||||
|
} |
||||||
Loading…
Reference in new issue