TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
376 B
23 lines
376 B
--TEST--
|
|
std vector: foreach
|
|
--FILE--
|
|
<?php
|
|
use native_types;
|
|
function main() {
|
|
$a = std::vector(Type::Int);
|
|
$n = 5;
|
|
while($n--){
|
|
$a[] = random_int(1, 1000);
|
|
}
|
|
$count = array_sum($a);
|
|
var_dump($count >= 5);
|
|
$total = 0;
|
|
foreach($a as $v){
|
|
$total += $v;
|
|
}
|
|
var_dump($total == $count);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|
|
|