- 创建对象重新赋值为数组的测试用例 - 创建字符串重新赋值给对象参数的测试用例 - 验证类型安全和变量重分配行为 - 测试对象到数组的类型转换场景 - 测试函数参数类型约束验证逻辑pull/1/head
parent
05854e55be
commit
10a66b1c31
2 changed files with 22 additions and 0 deletions
@ -0,0 +1,7 @@ |
||||
<?php |
||||
|
||||
function main() |
||||
{ |
||||
$obj = []; |
||||
$obj = new stdClass(); |
||||
} |
||||
@ -0,0 +1,15 @@ |
||||
<?php |
||||
function bar() |
||||
{ |
||||
return 'string'; |
||||
} |
||||
function foo(stdClass $o) |
||||
{ |
||||
$o = bar(); |
||||
} |
||||
|
||||
function main() |
||||
{ |
||||
$obj = new stdClass(); |
||||
foo($obj); |
||||
} |
||||
Loading…
Reference in new issue