3v4l.org

run code in 300+ PHP versions simultaneously
<?php const MADNESS = <<<EOM <?php yield // this comment doesn't make sense, but hey, why not? /* the blank line above doesn't make sense either, as well as this comment */ /* and thinking about it – */ // why not go batshit crazy with this? /* he */ from gen2(); EOM; $comments = token_get_all("<?php" . substr(token_get_all(MADNESS)[2][1], 5, -4)); array_shift($comments); // drop <?php var_dump($comments);
Output for git.master_jit, git.master
array(8) { [0]=> array(3) { [0]=> int(393) [1]=> string(53) "// this comment doesn't make sense, but hey, why not?" [2]=> int(1) } [1]=> array(3) { [0]=> int(398) [1]=> string(6) " " [2]=> int(1) } [2]=> array(3) { [0]=> int(393) [1]=> string(77) "/* the blank line above doesn't make sense either, as well as this comment */" [2]=> int(3) } [3]=> array(3) { [0]=> int(398) [1]=> string(6) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(393) [1]=> string(31) "/* and thinking about it – */" [2]=> int(5) } [5]=> array(3) { [0]=> int(398) [1]=> string(1) " " [2]=> int(5) } [6]=> array(3) { [0]=> int(393) [1]=> string(47) "// why not go batshit crazy with this? /* he */" [2]=> int(5) } [7]=> array(3) { [0]=> int(398) [1]=> string(6) " " [2]=> int(5) } }
Output for rfc.property-hooks
array(8) { [0]=> array(3) { [0]=> int(394) [1]=> string(53) "// this comment doesn't make sense, but hey, why not?" [2]=> int(1) } [1]=> array(3) { [0]=> int(399) [1]=> string(6) " " [2]=> int(1) } [2]=> array(3) { [0]=> int(394) [1]=> string(77) "/* the blank line above doesn't make sense either, as well as this comment */" [2]=> int(3) } [3]=> array(3) { [0]=> int(399) [1]=> string(6) " " [2]=> int(3) } [4]=> array(3) { [0]=> int(394) [1]=> string(31) "/* and thinking about it – */" [2]=> int(5) } [5]=> array(3) { [0]=> int(399) [1]=> string(1) " " [2]=> int(5) } [6]=> array(3) { [0]=> int(394) [1]=> string(47) "// why not go batshit crazy with this? /* he */" [2]=> int(5) } [7]=> array(3) { [0]=> int(399) [1]=> string(6) " " [2]=> int(5) } }

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:
39.35 ms | 411 KiB | 5 Q