3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<'DATA' / NN JJ : : ; ; < SYM = SYM > SYM NN ? . @ IN SYM A DT NNP NNS PRP FW JJ LS NN NNPS VB A$ $ A&E NNP A&M NNP NN A&P NNP NN A&W NNP A-1 JJ NN A.A. NNP NN A.A.U. NNP A.B. NNP NN A.C. NNP A.D NN A.D. NNP FW NN RB DATA; function encode_lexicon($inFp, $outFp) { fwrite($outFp, "function get_lexicon()\n{\n return [\n"); while ($line = fgets($inFp)) { $parts = preg_split('/\s+/', trim($line)); $key = var_export(array_shift($parts), true); $vals = implode(', ', array_map('var_export', $parts, array_fill(0, count($parts), true))); fwrite($outFp, " {$key} => [{$vals}],\n"); } fwrite($outFp, " ];\n}\n"); } $inFp = fopen('php://temp', 'w+'); fwrite($inFp, $data); rewind($inFp); encode_lexicon($inFp, STDOUT);
Output for git.master, git.master_jit, rfc.property-hooks
function get_lexicon() { return [ '/' => ['NN', 'JJ'], ':' => [':'], ';' => [';'], '<' => ['SYM'], '=' => ['SYM'], '>' => ['SYM', 'NN'], '?' => ['.'], '@' => ['IN', 'SYM'], 'A' => ['DT', 'NNP', 'NNS', 'PRP', 'FW', 'JJ', 'LS', 'NN', 'NNPS', 'VB'], 'A$' => ['$'], 'A&E' => ['NNP'], 'A&M' => ['NNP', 'NN'], 'A&P' => ['NNP', 'NN'], 'A&W' => ['NNP'], 'A-1' => ['JJ', 'NN'], 'A.A.' => ['NNP', 'NN'], 'A.A.U.' => ['NNP'], 'A.B.' => ['NNP', 'NN'], 'A.C.' => ['NNP'], 'A.D' => ['NN'], 'A.D.' => ['NNP', 'FW', 'NN', 'RB'], ]; }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
93.47 ms | 1826 KiB | 4 Q