feat(examples): 添加字符串连接示例并改进yield示例输出

- 新增 concat.php 示例文件展示字符串连接操作
- 修改 yield.php 示例中的输出方式为循环打印每个值
- 将 yield 示例的 var_dump 替换为更清晰的逐行输出格式
pull/3/head
韩天峰 2 months ago
parent e16f103cc7
commit f0f72f651d
  1. 7
      examples/concat.php
  2. 4
      examples/yield.php

@ -0,0 +1,7 @@
<?php
$a = str_repeat('A', 10);
$b = ' = ';
$c = ' hello ';
$d = "\n";
var_dump($a. $b. $c. $d);

@ -3,6 +3,8 @@
function main()
{
require __DIR__ . '/fn.php';
var_dump(fn_test_yeild());
foreach (fn_test_yeild() as $value) {
echo $value . "\n";
}
}

Loading…
Cancel
Save