Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add php.par Test

  • Loading branch information...
commit 36b649dabea9b1cad525b5120345a64a346ee2a5 1 parent 219ded0
@badlee authored
Showing with 0 additions and 683 deletions.
  1. +0 −30 par/php.par
  2. +0 −15 test/php/benchmarks/arrayConversions100.phype
  3. +0 −15 test/php/benchmarks/arrayConversions1000.phype
  4. +0 −15 test/php/benchmarks/arrayConversions10000.phype
  5. +0 −15 test/php/benchmarks/arrayConversions500.phype
  6. +0 −15 test/php/benchmarks/arrayConversions5000.phype
  7. +0 −28 test/php/benchmarks/manyFunCalls100.phype
  8. +0 −28 test/php/benchmarks/manyFunCalls1000.phype
  9. +0 −28 test/php/benchmarks/manyFunCalls10000.phype
  10. +0 −28 test/php/benchmarks/manyFunCalls500.phype
  11. +0 −28 test/php/benchmarks/manyFunCalls5000.phype
  12. +0 −20 test/php/benchmarks/manyGCObjects100.phype
  13. +0 −20 test/php/benchmarks/manyGCObjects1000.phype
  14. +0 −20 test/php/benchmarks/manyGCObjects10000.phype
  15. +0 −20 test/php/benchmarks/manyGCObjects500.phype
  16. +0 −20 test/php/benchmarks/manyGCObjects5000.phype
  17. +0 −19 test/php/benchmarks/manyObjects100.phype
  18. +0 −19 test/php/benchmarks/manyObjects1000.phype
  19. +0 −19 test/php/benchmarks/manyObjects10000.phype
  20. +0 −19 test/php/benchmarks/manyObjects500.phype
  21. +0 −19 test/php/benchmarks/manyObjects5000.phype
  22. +0 −18 test/php/benchmarks/tripleDimArray100.phype
  23. +0 −18 test/php/benchmarks/tripleDimArray1000.phype
  24. +0 −18 test/php/benchmarks/tripleDimArray10000.phype
  25. +0 −18 test/php/benchmarks/tripleDimArray500.phype
  26. +0 −18 test/php/benchmarks/tripleDimArray5000.phype
  27. +0 −1  test/php/test.js
  28. +0 −11 test/php/testcases/arithmetics.phype
  29. +0 −8 test/php/testcases/arrayMultiTest.phype
  30. +0 −7 test/php/testcases/arrayTest.phype
  31. +0 −16 test/php/testcases/binops.phype
  32. +0 −12 test/php/testcases/boolTest.phype
  33. +0 −15 test/php/testcases/charDataEcho.phype
  34. +0 −12 test/php/testcases/classAttrHelloWorld.phype
  35. +0 −10 test/php/testcases/classConstructorHelloWorld.phype
  36. +0 −11 test/php/testcases/classFunctionHelloWorld.phype
  37. +0 −9 test/php/testcases/echoArrayHelloWorld.phype
  38. +0 −8 test/php/testcases/echoFunctionHelloWorld.phype
  39. +0 −9 test/php/testcases/echoMultiArrayHelloWorld.phype
  40. +0 −9 test/php/testcases/funCall.phype
  41. +0 −7 test/php/testcases/varAssignSelf.phype
  42. +0 −8 test/php/testcases/whileTest.phype
View
30 par/php.par
@@ -2044,36 +2044,6 @@ if (!phypeOut || phypeOut == 'undefined') {
var phypeOut = alert;
}
-/**
- * Creates an echo with non-PHP character data that precedes the first php-tag.
- */
-function preParse(str) {
- var firstPhp = str.indexOf('<?');
- var res = '';
- if (firstPhp > 0 || firstPhp == -1) {
- if (firstPhp == -1) firstPhp = str.length;
- var echoStr = '<? ';
- echoStr += "echo '"+str.substring(0,firstPhp).replace("'","\'")+"';";
- echoStr += ' ?>';
- res = echoStr+str.substring(firstPhp,str.length);
- } else {
- res = str;
- }
-
- return res
-}
-
-function interpret(str) {
- var error_cnt = 0;
- var error_off = new Array();
- var error_la = new Array();
-
- if( ( error_cnt = __parse( preParse(str), error_off, error_la ) ) > 0 ) {
- for(var i=0; i<error_cnt; i++)
- phypeOut( "Parse error near >"
- + str.substr( error_off[i], 30 ) + "<, expecting \"" + error_la[i].join() + "\"<br/>\n" );
- }
-}
/////////////
// PARSING //
View
15 test/php/benchmarks/arrayConversions100.phype
@@ -1,15 +0,0 @@
-<?
-// assertEcho '42'
-$i = 0;
-$a[0][0][0] = 42;
-while ($i < 100) {
- $test = $a;
- $test[0][0][0] = 42;
- $test[0][0] = 42;
- $test[0] = 42;
-
- $i = $i+1;
-}
-
-echo $test[0];
-?>
View
15 test/php/benchmarks/arrayConversions1000.phype
@@ -1,15 +0,0 @@
-<?
-// assertEcho '42'
-$i = 0;
-$a[0][0][0] = 42;
-while ($i < 1000) {
- $test = $a;
- $test[0][0][0] = 42;
- $test[0][0] = 42;
- $test[0] = 42;
-
- $i = $i+1;
-}
-
-echo $test[0];
-?>
View
15 test/php/benchmarks/arrayConversions10000.phype
@@ -1,15 +0,0 @@
-<?
-// assertEcho '42'
-$i = 0;
-$a[0][0][0] = 42;
-while ($i < 10000) {
- $test = $a;
- $test[0][0][0] = 42;
- $test[0][0] = 42;
- $test[0] = 42;
-
- $i = $i+1;
-}
-
-echo $test[0];
-?>
View
15 test/php/benchmarks/arrayConversions500.phype
@@ -1,15 +0,0 @@
-<?
-// assertEcho '42'
-$i = 0;
-$a[0][0][0] = 42;
-while ($i < 500) {
- $test = $a;
- $test[0][0][0] = 42;
- $test[0][0] = 42;
- $test[0] = 42;
-
- $i = $i+1;
-}
-
-echo $test[0];
-?>
View
15 test/php/benchmarks/arrayConversions5000.phype
@@ -1,15 +0,0 @@
-<?
-// assertEcho '42'
-$i = 0;
-$a[0][0][0] = 42;
-while ($i < 5000) {
- $test = $a;
- $test[0][0][0] = 42;
- $test[0][0] = 42;
- $test[0] = 42;
-
- $i = $i+1;
-}
-
-echo $test[0];
-?>
View
28 test/php/benchmarks/manyFunCalls100.phype
@@ -1,28 +0,0 @@
-<?
-// assertEcho '42'
-function theAnswer100($a) {
- $b = $a;
- $a = $a/$b;
- $a = $a*20+22;
-
- return $a;
-}
-
-$tmp = 0;
-$i = 0;
-while ($i < 100) {
- $var = 0;
- $tmp = theAnswer100(1);
- $var = $var+$tmp;
- $tmp = theAnswer100(1);
- $var = $var+$tmp;
- $tmp = theAnswer100(1);
- $var = $var+$tmp;
- $tmp = theAnswer100(1);
- $var = ($var+$tmp);
- $var = $var/4;
- $i = $i+1;
-}
-
-echo $var;
-?>
View
28 test/php/benchmarks/manyFunCalls1000.phype
@@ -1,28 +0,0 @@
-<?
-// assertEcho '42'
-function theAnswer1000($a) {
- $b = $a;
- $a = $a/$b;
- $a = $a*20+22;
-
- return $a;
-}
-
-$tmp = 0;
-$i = 0;
-while ($i < 1000) {
- $var = 0;
- $tmp = theAnswer1000(1);
- $var = $var+$tmp;
- $tmp = theAnswer1000(1);
- $var = $var+$tmp;
- $tmp = theAnswer1000(1);
- $var = $var+$tmp;
- $tmp = theAnswer1000(1);
- $var = ($var+$tmp);
- $var = $var/4;
- $i = $i+1;
-}
-
-echo $var;
-?>
View
28 test/php/benchmarks/manyFunCalls10000.phype
@@ -1,28 +0,0 @@
-<?
-// assertEcho '42'
-function theAnswer10000($a) {
- $b = $a;
- $a = $a/$b;
- $a = $a*20+22;
-
- return $a;
-}
-
-$tmp = 0;
-$i = 0;
-while ($i < 10000) {
- $var = 0;
- $tmp = theAnswer10000(1);
- $var = $var+$tmp;
- $tmp = theAnswer10000(1);
- $var = $var+$tmp;
- $tmp = theAnswer10000(1);
- $var = $var+$tmp;
- $tmp = theAnswer10000(1);
- $var = ($var+$tmp);
- $var = $var/4;
- $i = $i+1;
-}
-
-echo $var;
-?>
View
28 test/php/benchmarks/manyFunCalls500.phype
@@ -1,28 +0,0 @@
-<?
-// assertEcho '42'
-function theAnswer500($a) {
- $b = $a;
- $a = $a/$b;
- $a = $a*20+22;
-
- return $a;
-}
-
-$tmp = 0;
-$i = 0;
-while ($i < 500) {
- $var = 0;
- $tmp = theAnswer500(1);
- $var = $var+$tmp;
- $tmp = theAnswer500(1);
- $var = $var+$tmp;
- $tmp = theAnswer500(1);
- $var = $var+$tmp;
- $tmp = theAnswer500(1);
- $var = ($var+$tmp);
- $var = $var/4;
- $i = $i+1;
-}
-
-echo $var;
-?>
View
28 test/php/benchmarks/manyFunCalls5000.phype
@@ -1,28 +0,0 @@
-<?
-// assertEcho '42'
-function theAnswer5000($a) {
- $b = $a;
- $a = $a/$b;
- $a = $a*20+22;
-
- return $a;
-}
-
-$tmp = 0;
-$i = 0;
-while ($i < 5000) {
- $var = 0;
- $tmp = theAnswer5000(1);
- $var = $var+$tmp;
- $tmp = theAnswer5000(1);
- $var = $var+$tmp;
- $tmp = theAnswer5000(1);
- $var = $var+$tmp;
- $tmp = theAnswer5000(1);
- $var = ($var+$tmp);
- $var = $var/4;
- $i = $i+1;
-}
-
-echo $var;
-?>
View
20 test/php/benchmarks/manyGCObjects100.phype
@@ -1,20 +0,0 @@
-<?
-// assertEcho 'hello world'
-class testGC100 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 100) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new testGC100();
- $$varName = '';
- $i = $i+1;
-}
-
-echo 'hello world';
-?>
View
20 test/php/benchmarks/manyGCObjects1000.phype
@@ -1,20 +0,0 @@
-<?
-// assertEcho 'hello world'
-class testGC1000 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 1000) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new testGC1000();
- $$varName = '';
- $i = $i+1;
-}
-
-echo 'hello world';
-?>
View
20 test/php/benchmarks/manyGCObjects10000.phype
@@ -1,20 +0,0 @@
-<?
-// assertEcho 'hello world'
-class testGC10000 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 10000) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new testGC10000();
- $$varName = '';
- $i = $i+1;
-}
-
-echo 'hello world';
-?>
View
20 test/php/benchmarks/manyGCObjects500.phype
@@ -1,20 +0,0 @@
-<?
-// assertEcho 'hello world'
-class testGC500 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 500) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new testGC500();
- $$varName = '';
- $i = $i+1;
-}
-
-echo 'hello world';
-?>
View
20 test/php/benchmarks/manyGCObjects5000.phype
@@ -1,20 +0,0 @@
-<?
-// assertEcho 'hello world'
-class testGC5000 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 5000) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new testGC5000();
- $$varName = '';
- $i = $i+1;
-}
-
-echo 'hello world';
-?>
View
19 test/php/benchmarks/manyObjects100.phype
@@ -1,19 +0,0 @@
-<?
-// assertEcho 'hello world'
-class test100 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 100) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new test100();
- $i = $i+1;
-}
-
-echo $test99->hi();
-?>
View
19 test/php/benchmarks/manyObjects1000.phype
@@ -1,19 +0,0 @@
-<?
-// assertEcho 'hello world'
-class test1000 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 1000) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new test1000();
- $i = $i+1;
-}
-
-echo $test999->hi();
-?>
View
19 test/php/benchmarks/manyObjects10000.phype
@@ -1,19 +0,0 @@
-<?
-// assertEcho 'hello world'
-class test10000 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 10000) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new test10000();
- $i = $i+1;
-}
-
-echo $test9999->hi();
-?>
View
19 test/php/benchmarks/manyObjects500.phype
@@ -1,19 +0,0 @@
-<?
-// assertEcho 'hello world'
-class test500 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 500) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new test500();
- $i = $i+1;
-}
-
-echo $test499->hi();
-?>
View
19 test/php/benchmarks/manyObjects5000.phype
@@ -1,19 +0,0 @@
-<?
-// assertEcho 'hello world'
-class test5000 {
- function hi() {
- return 'hello world';
- }
-}
-
-$i = 0;
-$varName = 'test';
-while ($i < 5000) {
- $$varName = '';
- $varName = 'test'.$i;
- $$varName = new test5000();
- $i = $i+1;
-}
-
-echo $test4999->hi();
-?>
View
18 test/php/benchmarks/tripleDimArray100.phype
@@ -1,18 +0,0 @@
-<?
-// assertEcho 'hello world'
-$i = 0;
-$j = 0;
-$k = 0;
-while ($i < 100) {
- while ($j < 100) {
- while ($k < 100) {
- $arr[$i][$j][$k] = 'hello world';
- $i = $i+1;
- $j = $j+1;
- $k = $k+1;
- }
- }
-}
-echo $arr[99][99][99];
-
-?>
View
18 test/php/benchmarks/tripleDimArray1000.phype
@@ -1,18 +0,0 @@
-<?
-// assertEcho 'hello world'
-$i = 0;
-$j = 0;
-$k = 0;
-while ($i < 1000) {
- while ($j < 1000) {
- while ($k < 1000) {
- $arr[$i][$j][$k] = 'hello world';
- $i = $i+1;
- $j = $j+1;
- $k = $k+1;
- }
- }
-}
-echo $arr[999][999][999];
-
-?>
View
18 test/php/benchmarks/tripleDimArray10000.phype
@@ -1,18 +0,0 @@
-<?
-// assertEcho 'hello world'
-$i = 0;
-$j = 0;
-$k = 0;
-while ($i < 10000) {
- while ($j < 10000) {
- while ($k < 10000) {
- $arr[$i][$j][$k] = 'hello world';
- $i = $i+1;
- $j = $j+1;
- $k = $k+1;
- }
- }
-}
-echo $arr[9999][9999][9999];
-
-?>
View
18 test/php/benchmarks/tripleDimArray500.phype
@@ -1,18 +0,0 @@
-<?
-// assertEcho 'hello world'
-$i = 0;
-$j = 0;
-$k = 0;
-while ($i < 500) {
- while ($j < 500) {
- while ($k < 500) {
- $arr[$i][$j][$k] = 'hello world';
- $i = $i+1;
- $j = $j+1;
- $k = $k+1;
- }
- }
-}
-echo $arr[499][499][499];
-
-?>
View
18 test/php/benchmarks/tripleDimArray5000.phype
@@ -1,18 +0,0 @@
-<?
-// assertEcho 'hello world'
-$i = 0;
-$j = 0;
-$k = 0;
-while ($i < 5000) {
- while ($j < 5000) {
- while ($k < 5000) {
- $arr[$i][$j][$k] = 'hello world';
- $i = $i+1;
- $j = $j+1;
- $k = $k+1;
- }
- }
-}
-echo $arr[4999][4999][4999];
-
-?>
View
1  test/php/test.js
@@ -1 +0,0 @@
-require("")
View
11 test/php/testcases/arithmetics.phype
@@ -1,11 +0,0 @@
-<?
-// assertEcho '42'
-function get42() {
- return 42;
-}
-
-$twentyOne = 21;
-$crazy = 1*get42()-(get42()/2)+3*2+4+1*2+30-$twentyOne;
-
-echo $crazy;
-?>
View
8 test/php/testcases/arrayMultiTest.phype
@@ -1,8 +0,0 @@
-<?
-// assertEcho 'hello world'
-$arr['foo']['bar'] = 'hello';
-$arr[1] = 'world';
-$arr['foo']['2'] = ' ';
-
-echo $arr['foo']['bar'].$arr['foo'][2].$arr[1];
-?>
View
7 test/php/testcases/arrayTest.phype
@@ -1,7 +0,0 @@
-<?
-// assertEcho 'hello world'
-$arr['foo'] = 'hello';
-$arr[1] = 'world';
-
-echo $arr['foo'].' '.$arr[1];
-?>
View
16 test/php/testcases/binops.phype
@@ -1,16 +0,0 @@
-<?
-// assertEcho '011-10111201'
-$a = 1;
-$b = 0;
-
-echo ($a < $b);
-echo ($a > $b);
-echo ($a + $b);
-echo ($b - $a);
-echo ($b . $a);
-echo ($a <= $a);
-echo ($b >= $b);
-echo ($a = $a+$a);
-echo ($a = $a-$a);
-echo ($a = $a+1);
-?>
View
12 test/php/testcases/boolTest.phype
@@ -1,12 +0,0 @@
-<?
-// assertEcho 'hello world'
-if (true) echo 'hello';
-if (false) echo -1;
-
-$a = true;
-if ($a) { echo ' '; }
-if (!$a) echo -1;
-
-$foo = 'bar';
-if ($foo) echo 'world';
-?>
View
15 test/php/testcases/charDataEcho.phype
@@ -1,15 +0,0 @@
-<?
-// assertEcho 'hejfarhejfarhej'
-$i = 0;
-$a = true;
-while ($i < 5) {
- if ($a) {
- ?>hej<?
- $a = false;
- } else {
- ?>far<?
- $a = true;
- }
- $i = $i+1;
-}
-?>
View
12 test/php/testcases/classAttrHelloWorld.phype
@@ -1,12 +0,0 @@
-<?
-// assertEcho 'hello world'
-class test {
- private $foo = 'hello world';
- function hi() {
- echo $this->foo;
- }
-}
-
-$foo = new test();
-$foo->hi();
-?>
View
10 test/php/testcases/classConstructorHelloWorld.phype
@@ -1,10 +0,0 @@
-<?
-// assertEcho 'hello world'
-class foo {
- function foo() {
- echo 'hello world';
- }
-}
-
-$foo = new foo();
-?>
View
11 test/php/testcases/classFunctionHelloWorld.phype
@@ -1,11 +0,0 @@
-<?
-// assertEcho 'hello world'
-class bar {
- function hi() {
- echo 'hello world';
- }
-}
-
-$foo = new bar();
-$foo->hi();
-?>
View
9 test/php/testcases/echoArrayHelloWorld.phype
@@ -1,9 +0,0 @@
-<?
- // assertEcho 'hello world'
- $a[0] = 'hello';
- $b[0] = 'world';
-
- echo $a[0];
- echo ' ';
- echo $b[0];
-?>
View
8 test/php/testcases/echoFunctionHelloWorld.phype
@@ -1,8 +0,0 @@
-<?
-// assertEcho 'hello world'
-function helloWorld() {
- return 'hello world';
-}
-
-echo helloWorld();
-?>
View
9 test/php/testcases/echoMultiArrayHelloWorld.phype
@@ -1,9 +0,0 @@
-<?
- // assertEcho 'hello world'
- $a[0][0] = 'hello';
- $a[0][1] = 'world';
-
- echo $a[0][0];
- echo ' ';
- echo $a[0][1];
-?>
View
9 test/php/testcases/funCall.phype
@@ -1,9 +0,0 @@
-<?
-// assertEcho 'hello world'
-
-function test($a) {
- return $a;
-}
-
-echo test('hello world');
-?>
View
7 test/php/testcases/varAssignSelf.phype
@@ -1,7 +0,0 @@
-<?
-// assertEcho '42'
-$a = 41;
-
-$a = $a+1;
-echo $a;
-?>
View
8 test/php/testcases/whileTest.phype
@@ -1,8 +0,0 @@
-<?
-// assertEcho '0123456789'
-$i = 0;
-while ($i < 10) {
- echo $i;
- $i = $i+1;
-}
-?>

0 comments on commit 36b649d

Please sign in to comment.
Something went wrong with that request. Please try again.