summaryrefslogtreecommitdiff
path: root/ext/tokenizer
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-03 22:52:20 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-02-03 22:52:20 +0100
commitf8d795820e780a6322e054c26c581570613c14f0 (patch)
tree99d3ae01ce564752807341c5743863b4c92513f8 /ext/tokenizer
parentd2cb200e10ada6fa44c54a29292bb4665728fff0 (diff)
downloadphp-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz
Reindent phpt files
Diffstat (limited to 'ext/tokenizer')
-rw-r--r--ext/tokenizer/tests/002.phpt12
-rw-r--r--ext/tokenizer/tests/bug54089.phpt28
-rw-r--r--ext/tokenizer/tests/token_get_all_variation19.phpt22
3 files changed, 31 insertions, 31 deletions
diff --git a/ext/tokenizer/tests/002.phpt b/ext/tokenizer/tests/002.phpt
index 11b6d9f78e..e711023eef 100644
--- a/ext/tokenizer/tests/002.phpt
+++ b/ext/tokenizer/tests/002.phpt
@@ -6,15 +6,15 @@ token_get_all()
<?php
$strings = array(
- '<?php echo 1; if (isset($a)) print $a+1; $a++; $a--; $a == 2; $a === 2; endif; ?>',
- '<?php switch($a) { case 1: break; default: break; } while($a) { exit; } ?>',
- '<?php /* comment */ if (1 || 2) { } $a = 2 | 1; $b = 3^2; $c = 4&2; ?>',
- /* feel free to add more yourself */
- 'wrong syntax here'
+ '<?php echo 1; if (isset($a)) print $a+1; $a++; $a--; $a == 2; $a === 2; endif; ?>',
+ '<?php switch($a) { case 1: break; default: break; } while($a) { exit; } ?>',
+ '<?php /* comment */ if (1 || 2) { } $a = 2 | 1; $b = 3^2; $c = 4&2; ?>',
+ /* feel free to add more yourself */
+ 'wrong syntax here'
);
foreach ($strings as $s) {
- var_dump(token_get_all($s));
+ var_dump(token_get_all($s));
}
echo "Done\n";
diff --git a/ext/tokenizer/tests/bug54089.phpt b/ext/tokenizer/tests/bug54089.phpt
index ff461ecb78..d3dc834616 100644
--- a/ext/tokenizer/tests/bug54089.phpt
+++ b/ext/tokenizer/tests/bug54089.phpt
@@ -5,23 +5,23 @@ Bug #54089 (token_get_all() does not stop after __halt_compiler)
--FILE--
<?php
$codes = array(
- "<?php __halt_compiler",
- "<?php __halt_compiler(",
- "<?php __halt_compiler();",
- "<?php __halt_compiler();ABC",
- "<?php __halt_compiler\n(\n)\n;ABC",
- "<?php __halt_compiler\nabc\ndef\nghi ABC",
+ "<?php __halt_compiler",
+ "<?php __halt_compiler(",
+ "<?php __halt_compiler();",
+ "<?php __halt_compiler();ABC",
+ "<?php __halt_compiler\n(\n)\n;ABC",
+ "<?php __halt_compiler\nabc\ndef\nghi ABC",
);
foreach ($codes as $code) {
- $tokens = token_get_all($code);
- var_dump($tokens);
+ $tokens = token_get_all($code);
+ var_dump($tokens);
- $code = '';
- foreach ($tokens as $t)
- {
- $code .= isset($t[1]) ? $t[1] : $t;
- }
- var_dump($code);
+ $code = '';
+ foreach ($tokens as $t)
+ {
+ $code .= isset($t[1]) ? $t[1] : $t;
+ }
+ var_dump($code);
}
?>
diff --git a/ext/tokenizer/tests/token_get_all_variation19.phpt b/ext/tokenizer/tests/token_get_all_variation19.phpt
index a853dd2e2f..3190b3fd16 100644
--- a/ext/tokenizer/tests/token_get_all_variation19.phpt
+++ b/ext/tokenizer/tests/token_get_all_variation19.phpt
@@ -35,17 +35,17 @@ $token_array = token_get_all($phpstr);
$script = "";
// reconstruct a script (without open/close tags) from the token array
foreach ($token_array as $token) {
- if (is_array($token)) {
- if (strncmp($token[1], '<?php', 5) == 0) {
- continue;
- }
- if (strncmp($token[1], '?>', 2) == 0) {
- continue;
- }
- $script .= $token[1];
- } else {
- $script .= $token;
- }
+ if (is_array($token)) {
+ if (strncmp($token[1], '<?php', 5) == 0) {
+ continue;
+ }
+ if (strncmp($token[1], '?>', 2) == 0) {
+ continue;
+ }
+ $script .= $token[1];
+ } else {
+ $script .= $token;
+ }
}
var_dump($script);