diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /scripts/dev/generate-phpt/src/codeSnippets | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'scripts/dev/generate-phpt/src/codeSnippets')
15 files changed, 84 insertions, 0 deletions
diff --git a/scripts/dev/generate-phpt/src/codeSnippets/array.txt b/scripts/dev/generate-phpt/src/codeSnippets/array.txt new file mode 100644 index 0000000..69a4af7 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/array.txt @@ -0,0 +1,9 @@ +$index_array = array(1, 2, 3); +$assoc_array = array(1 => 'one', 2 => 'two'); + +$variation_array = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + );
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/boolean.txt b/scripts/dev/generate-phpt/src/codeSnippets/boolean.txt new file mode 100644 index 0000000..53db40d --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/boolean.txt @@ -0,0 +1,6 @@ +$variation_array = array( + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + );
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/commentEnd.txt b/scripts/dev/generate-phpt/src/codeSnippets/commentEnd.txt new file mode 100644 index 0000000..d116022 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/commentEnd.txt @@ -0,0 +1,2 @@ + * + */
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/commentStart.txt b/scripts/dev/generate-phpt/src/codeSnippets/commentStart.txt new file mode 100644 index 0000000..e3466d5 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/commentStart.txt @@ -0,0 +1,2 @@ +/** + *
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt b/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt new file mode 100644 index 0000000..7e28494 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt @@ -0,0 +1,11 @@ +$unset_var = 10; +unset($unset_var); + +$variation_array = array( + 'unset var' => @$unset_var, + 'undefined var' => @$undefined_var, + 'empty string DQ' => "", + 'empty string SQ' => '', + 'uppercase NULL' => NULL, + 'lowercase null' => null, + );
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/float.txt b/scripts/dev/generate-phpt/src/codeSnippets/float.txt new file mode 100644 index 0000000..75c2b6c --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/float.txt @@ -0,0 +1,7 @@ +$variation_array = array( + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + );
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/int.txt b/scripts/dev/generate-phpt/src/codeSnippets/int.txt new file mode 100644 index 0000000..cdd28ae --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/int.txt @@ -0,0 +1,6 @@ +$variation_array = array ( + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + );
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/loopClose.txt b/scripts/dev/generate-phpt/src/codeSnippets/loopClose.txt new file mode 100644 index 0000000..ff30235 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/loopClose.txt @@ -0,0 +1 @@ +}
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/loopStart.txt b/scripts/dev/generate-phpt/src/codeSnippets/loopStart.txt new file mode 100644 index 0000000..8fd5eb2 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/loopStart.txt @@ -0,0 +1 @@ +foreach ( $variation_array as $var ) {
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/object.txt b/scripts/dev/generate-phpt/src/codeSnippets/object.txt new file mode 100644 index 0000000..28ee61b --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/object.txt @@ -0,0 +1,25 @@ +function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { + if (error_reporting() != 0) { + // report non-silenced errors + echo "Error: $err_no - $err_msg, $filename($linenum)\n"; + } +} +set_error_handler('test_error_handler'); + + + +class classWithToString +{ + public function __toString() { + return "Class A object"; + } +} + +class classWithoutToString +{ +} + +$variation_array = array( + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + );
\ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/codeSnippets/skipif64b.txt b/scripts/dev/generate-phpt/src/codeSnippets/skipif64b.txt new file mode 100644 index 0000000..f05e980 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/skipif64b.txt @@ -0,0 +1 @@ +if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); diff --git a/scripts/dev/generate-phpt/src/codeSnippets/skipifnot64b.txt b/scripts/dev/generate-phpt/src/codeSnippets/skipifnot64b.txt new file mode 100644 index 0000000..e44071a --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/skipifnot64b.txt @@ -0,0 +1 @@ +if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); diff --git a/scripts/dev/generate-phpt/src/codeSnippets/skipifnotwin.txt b/scripts/dev/generate-phpt/src/codeSnippets/skipifnotwin.txt new file mode 100644 index 0000000..75ea3e1 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/skipifnotwin.txt @@ -0,0 +1 @@ +if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only"); diff --git a/scripts/dev/generate-phpt/src/codeSnippets/skipifwin.txt b/scripts/dev/generate-phpt/src/codeSnippets/skipifwin.txt new file mode 100644 index 0000000..f712116 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/skipifwin.txt @@ -0,0 +1 @@ +if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test is not for Windows platforms"); diff --git a/scripts/dev/generate-phpt/src/codeSnippets/string.txt b/scripts/dev/generate-phpt/src/codeSnippets/string.txt new file mode 100644 index 0000000..a1d4237 --- /dev/null +++ b/scripts/dev/generate-phpt/src/codeSnippets/string.txt @@ -0,0 +1,10 @@ +$heredoc = <<<EOT +hello world +EOT; + +$variation_array = array( + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + );
\ No newline at end of file |