summaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
Diffstat (limited to 'php')
-rw-r--r--php/class.php25
-rw-r--r--php/for.php7
2 files changed, 32 insertions, 0 deletions
diff --git a/php/class.php b/php/class.php
new file mode 100644
index 0000000..a2d7875
--- /dev/null
+++ b/php/class.php
@@ -0,0 +1,25 @@
+<?php
+
+class Foo {
+ public $aMemberVar = 'aMemberVar Member Variable';
+ public $aFuncName = 'aMemberFunc';
+ private $anotherVar = 'xxx';
+
+ function aMemberFunc() {
+ return 'Inside `aMemberFunc()`';
+ }
+}
+
+$foo = new Foo;
+
+$s = "asdf ";
+$s .= $foo->aMemberFunc();
+$s .= " xxx";
+//$s .= $foo->anotherVar;
+$s .= "\n";
+echo $s;
+
+$x = 2+3;
+echo $x;
+?>
+
diff --git a/php/for.php b/php/for.php
new file mode 100644
index 0000000..e8f959a
--- /dev/null
+++ b/php/for.php
@@ -0,0 +1,7 @@
+<?php
+
+for ($i = 0; $i < 2; $i++) {
+ echo $i."\n";
+}
+?>
+