From aff56f3c4539869910cf2778cf0ece2d8c2dd671 Mon Sep 17 00:00:00 2001 From: datibbaw Date: Tue, 19 Nov 2013 15:36:06 +0800 Subject: 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 --- ext/tokenizer/tests/bug60097.phpt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ext/tokenizer/tests/bug60097.phpt') diff --git a/ext/tokenizer/tests/bug60097.phpt b/ext/tokenizer/tests/bug60097.phpt index 2116866c93..c3f417a7d5 100644 --- a/ext/tokenizer/tests/bug60097.phpt +++ b/ext/tokenizer/tests/bug60097.phpt @@ -17,7 +17,7 @@ array(14) { [0]=> array(3) { [0]=> - int(374) + int(376) [1]=> string(6) " array(3) { [0]=> - int(378) + int(380) [1]=> string(8) "<< array(3) { [0]=> - int(381) + int(383) [1]=> string(1) "{" [2]=> @@ -46,7 +46,7 @@ array(14) { [3]=> array(3) { [0]=> - int(310) + int(312) [1]=> string(2) "$s" [2]=> @@ -57,7 +57,7 @@ array(14) { [5]=> array(3) { [0]=> - int(378) + int(380) [1]=> string(8) "<< array(3) { [0]=> - int(379) + int(381) [1]=> string(4) "DOC2" [2]=> @@ -76,7 +76,7 @@ array(14) { [7]=> array(3) { [0]=> - int(377) + int(379) [1]=> string(1) " " @@ -90,7 +90,7 @@ array(14) { [10]=> array(3) { [0]=> - int(315) + int(317) [1]=> string(1) " " @@ -100,7 +100,7 @@ array(14) { [11]=> array(3) { [0]=> - int(379) + int(381) [1]=> string(4) "DOC1" [2]=> @@ -111,7 +111,7 @@ array(14) { [13]=> array(3) { [0]=> - int(377) + int(379) [1]=> string(1) " " -- cgit v1.2.1