1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
archived-php-src/ext/tokenizer/tests/bug60097.phpt
T
datibbaw aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00

122 lines
1.2 KiB
PHP

--TEST--
Bug 60097: token_get_all fails to lex nested heredoc
--FILE--
<?php
var_dump(token_get_all('<?php
<<<DOC1
{$s(<<<DOC2
DOC2
)}
DOC1;
'));
?>
--EXPECT--
array(14) {
[0]=>
array(3) {
[0]=>
int(376)
[1]=>
string(6) "<?php
"
[2]=>
int(1)
}
[1]=>
array(3) {
[0]=>
int(380)
[1]=>
string(8) "<<<DOC1
"
[2]=>
int(2)
}
[2]=>
array(3) {
[0]=>
int(383)
[1]=>
string(1) "{"
[2]=>
int(3)
}
[3]=>
array(3) {
[0]=>
int(312)
[1]=>
string(2) "$s"
[2]=>
int(3)
}
[4]=>
string(1) "("
[5]=>
array(3) {
[0]=>
int(380)
[1]=>
string(8) "<<<DOC2
"
[2]=>
int(3)
}
[6]=>
array(3) {
[0]=>
int(381)
[1]=>
string(4) "DOC2"
[2]=>
int(4)
}
[7]=>
array(3) {
[0]=>
int(379)
[1]=>
string(1) "
"
[2]=>
int(4)
}
[8]=>
string(1) ")"
[9]=>
string(1) "}"
[10]=>
array(3) {
[0]=>
int(317)
[1]=>
string(1) "
"
[2]=>
int(5)
}
[11]=>
array(3) {
[0]=>
int(381)
[1]=>
string(4) "DOC1"
[2]=>
int(6)
}
[12]=>
string(1) ";"
[13]=>
array(3) {
[0]=>
int(379)
[1]=>
string(1) "
"
[2]=>
int(6)
}
}