File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ var_dump (
4+ opcache_compile_file (__DIR__ . '/test.php ' )
5+ );
Original file line number Diff line number Diff line change 1+ <?php
2+ $ show_value = 123 ;
3+ echo 'sing_quote ' . $ show_value ;
4+ function test ()
5+ {
6+ return DateTimeImmutable::createFromFormat ('123 ' );
7+ }
8+
9+ throw E;
10+ echo "double_quote {$ show_value }" ;
11+
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ echo json_encode (
4+ array_map (
5+ function (PhpToken $ token ) {
6+ return [
7+ 'line ' => $ token ->line ,
8+ 'pos ' => $ token ->pos ,
9+ 'name ' => $ token ->getTokenName (),
10+ 'value ' => $ token ->text ,
11+ ];
12+ },
13+ \PhpToken::tokenize (file_get_contents ($ argv [1 ])),
14+ )
15+ );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ echo json_encode (
4+ array_map (
5+ function ($ token ) {
6+ return [
7+ 'line ' => $ isArray = is_array ($ token ) ? $ token [2 ] : null ,
8+ 'name ' => $ isArray ? token_name ($ token [0 ]) : null ,
9+ 'value ' => $ isArray ? $ token [1 ] : $ token ,
10+ ];
11+ },
12+ token_get_all (
13+ file_get_contents ($ argv [1 ])
14+ ),
15+ )
16+ );
You can’t perform that action at this time.
0 commit comments