summaryrefslogtreecommitdiff
path: root/ext/tokenizer
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2017-10-08 23:40:27 +0200
committerJoe Watkins <krakjoe@php.net>2017-10-19 12:06:10 +0100
commit7f4722a42f326519c07256ac7b3a3a811719d66e (patch)
tree0e08802e5c8848e93575ebb0a56163401f22de26 /ext/tokenizer
parent842ba86c341c36a4da51aa6cdf78f4aaa8c0bf35 (diff)
downloadphp-git-7f4722a42f326519c07256ac7b3a3a811719d66e.tar.gz
Remove tokenizer PHP example script
The tokenizer extension is best presented in the PHP manual with some code snippets. Also the script includes old PHP dl() function.
Diffstat (limited to 'ext/tokenizer')
-rw-r--r--ext/tokenizer/tokenizer.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/ext/tokenizer/tokenizer.php b/ext/tokenizer/tokenizer.php
deleted file mode 100644
index c13063c628..0000000000
--- a/ext/tokenizer/tokenizer.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-if(!extension_loaded('tokenizer')) {
- dl('tokenizer.so');
-}
-
-$fp = fopen('php://stdin', 'r');
-while (!feof($fp)) {
- $content .= fread($fp, 4096);
-}
-fclose($fp);
-
-$tokens = token_get_all($content);
-
-$count = count($tokens);
-$state = 0;
-for ($i = 0; $i < $count; $i++) {
- $token = $tokens[$i];
- if (is_array($token)) {
- if ($state == 1 && $token[0] == T_STRING) {
- $token[1] = preg_replace('!([a-z])([A-Z])!e', '"$1_".strtolower("$2")', $token[1]);
- $state = 0;
- } else if ($token[0] == T_FUNCTION) {
- $state = 1;
- }
- $chunk = $token[1];
- } else {
- $chunk = $token;
- }
- $output .= $chunk;
-}
-
-print $output;
-
-?>