<?php
var_dump(token_get_all('<?php yield /* comment */ from $foo;'));
- Output for 8.3.1, 8.3.3, 8.3.5 - 8.3.6, 8.3.8, 8.3.10, 8.3.12, 8.3.14
- array(5) {
[0]=>
array(3) {
[0]=>
int(389)
[1]=>
string(6) "<?php "
[2]=>
int(1)
}
[1]=>
array(3) {
[0]=>
int(282)
[1]=>
string(24) "yield /* comment */ from"
[2]=>
int(1)
}
[2]=>
array(3) {
[0]=>
int(392)
[1]=>
string(1) " "
[2]=>
int(1)
}
[3]=>
array(3) {
[0]=>
int(266)
[1]=>
string(4) "$foo"
[2]=>
int(1)
}
[4]=>
string(1) ";"
}
- Output for 8.3.0, 8.3.2, 8.3.4, 8.3.7, 8.3.9, 8.3.11, 8.3.13
- array(5) {
[0]=>
array(3) {
[0]=>
int(394)
[1]=>
string(6) "<?php "
[2]=>
int(1)
}
[1]=>
array(3) {
[0]=>
int(270)
[1]=>
string(24) "yield /* comment */ from"
[2]=>
int(1)
}
[2]=>
array(3) {
[0]=>
int(397)
[1]=>
string(1) " "
[2]=>
int(1)
}
[3]=>
array(3) {
[0]=>
int(317)
[1]=>
string(4) "$foo"
[2]=>
int(1)
}
[4]=>
string(1) ";"
}
- Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25
- array(9) {
[0]=>
array(3) {
[0]=>
int(389)
[1]=>
string(6) "<?php "
[2]=>
int(1)
}
[1]=>
array(3) {
[0]=>
int(281)
[1]=>
string(5) "yield"
[2]=>
int(1)
}
[2]=>
array(3) {
[0]=>
int(392)
[1]=>
string(1) " "
[2]=>
int(1)
}
[3]=>
array(3) {
[0]=>
int(387)
[1]=>
string(13) "/* comment */"
[2]=>
int(1)
}
[4]=>
array(3) {
[0]=>
int(392)
[1]=>
string(1) " "
[2]=>
int(1)
}
[5]=>
array(3) {
[0]=>
int(262)
[1]=>
string(4) "from"
[2]=>
int(1)
}
[6]=>
array(3) {
[0]=>
int(392)
[1]=>
string(1) " "
[2]=>
int(1)
}
[7]=>
array(3) {
[0]=>
int(266)
[1]=>
string(4) "$foo"
[2]=>
int(1)
}
[8]=>
string(1) ";"
}
preferences:
55.52 ms | 411 KiB | 5 Q