Add some test files.
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Sep 2019 00:30:34 +0000 (20:30 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Sep 2019 03:41:24 +0000 (23:41 -0400)
dev/tests/Cyrillic-array-key.php [new file with mode: 0644]
dev/tests/bug-207.php [new file with mode: 0644]
dev/tests/exception.php [new file with mode: 0644]
dev/tests/long_array.php [new file with mode: 0644]
dev/tests/space name.php [new file with mode: 0644]
dev/tests/static.php [new file with mode: 0644]

diff --git a/dev/tests/Cyrillic-array-key.php b/dev/tests/Cyrillic-array-key.php
new file mode 100644 (file)
index 0000000..4cae5c2
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+
+$a = [];
+
+$a['LФЯЄԠ PЇPSЏԠ DФLФЯ SЇҬ ДԠЇԐҐ'] = 'LФЯЄԠ PЇPSЏԠ DФLФЯ SЇҬ ДԠЇԐҐ';
+
+foreach ($a as $k => $v) {
+  print_r($k);
+  print_r($v);
+}
+
diff --git a/dev/tests/bug-207.php b/dev/tests/bug-207.php
new file mode 100644 (file)
index 0000000..fb2e3aa
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
+<title>Title</title>
+
+</head>
+<body id="body">
+<form action="#" method="post" accept-charset="utf-8" id="myform">
+<?php for ($i=0;$i<100;$i++): ?>
+<label for="form-data-<?php echo $i ?>"><?php echo "Data $i" ?></label>
+<input type="text" name="form[data::<?php echo $i ?>]" value="<?php echo $_POST['form']["data::$i"] ?>x<?= $i ?>" id="form-data-<?php echo $i ?>"/>
+<?php endfor?>
+
+<p><input type="submit" value="Submit →"/></p>
+</form>
+<?php var_dump($_POST) ?>
+</body>
+</html>
diff --git a/dev/tests/exception.php b/dev/tests/exception.php
new file mode 100644 (file)
index 0000000..c2ade86
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+class CustomException extends Exception {}
+
+function DoSomething() {
+    throw new CustomException('Hi There');
+}
+
+function Something() {
+    $c = 42;
+    $d = 12;
+    throw new Exception('Boo');
+}
+
+Something();
diff --git a/dev/tests/long_array.php b/dev/tests/long_array.php
new file mode 100644 (file)
index 0000000..a7ef7df
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+$a = [];
+
+for ($i = 0; $i < 2048; ++$i) {
+  $a[$i] = $i;
+}
+
+print_r($a);
+
diff --git a/dev/tests/space name.php b/dev/tests/space name.php
new file mode 100644 (file)
index 0000000..34acd25
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+function OK() {
+  print 'This is OK';
+  foreach ($_SERVER AS $k => $v) {
+    print "$k ==> $v";
+  }
+}
+
+OK();
diff --git a/dev/tests/static.php b/dev/tests/static.php
new file mode 100644 (file)
index 0000000..688e554
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+class C {
+  private static $bar;
+
+  public static function test() {
+    self::$bar = 'moo';
+  }
+
+  public static function moo() {
+    return self::$bar;
+  }
+}
+
+C::test();
+
+C::moo();
+