From 95e9b6fef4e6c594af0f76e87564acc049b0cba3 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Mon, 29 Jun 2026 14:01:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(samples):=20=E6=B7=BB=E5=8A=A0PHP=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E4=BB=A3=E7=A0=81=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增c1.php包含函数定义和调用示例 - 新增c2.php包含类静态方法和实例方法示例 - 新增c3.php包含require语句和系统函数调用示例 - 新增c4.php包含继承类方法重写和uname函数示例 --- samples/c1.php | 14 ++++++++++++++ samples/c2.php | 20 ++++++++++++++++++++ samples/c3.php | 6 ++++++ samples/c4.php | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 samples/c1.php create mode 100644 samples/c2.php create mode 100644 samples/c3.php create mode 100644 samples/c4.php diff --git a/samples/c1.php b/samples/c1.php new file mode 100644 index 00000000..5e29ce44 --- /dev/null +++ b/samples/c1.php @@ -0,0 +1,14 @@ +func2('php'); +} diff --git a/samples/c3.php b/samples/c3.php new file mode 100644 index 00000000..897b6422 --- /dev/null +++ b/samples/c3.php @@ -0,0 +1,6 @@ +bar(); + } +} + +class Child extends Base +{ + function bar() + { + var_dump(__METHOD__); + } +} + +function my_uname_func() +{ + var_dump(php_uname()); +} + +function main() +{ + $obj1 = new Child(); + $obj1->run(); + + $obj2 = new Base(); + $obj2->run(); +}