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
* str_erealloc behaves like erealloc for normal strings, but will
use emalloc+memcpy for interned strings.
* str_estrndup behaves like estrndup for normal strings, but will
not copy interned strings.
* str_strndup behaves like zend_strndup for normal strings, but
will not copy interned strings.
* str_efree_rel behaves like efree_rel for normal strings, but
will not free interned strings.
* str_hash will return INTERNED_HASH for interned strings and
compute it using zend_hash_func for normal strings.
* PHP-5.4:
Fix bug #64936 - clean doc comment state at the beginning and end of the scan
ws fix
Conflicts:
Zend/zend_language_scanner.c
Zend/zend_language_scanner.l
Zend/zend_language_scanner_defs.h
This is just an intial merge. It does not yet make generators and finally
work together.
Conflicts:
Zend/zend_language_scanner.c
Zend/zend_language_scanner_defs.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl
Zend/zend_vm_opcodes.h
Generate T_STRING_VARNAME only if it actually is one. This is only the case
for "${varname}" and "${varname[offset]}" so we can just add a check for
} or [ after the LABEL.
This fixes bug #60097.
Before two global variables CG(heredoc) and CG(heredoc_len) were used to
track the current heredoc label. In order to support nested heredoc
strings the *previous* heredoc label was assigned as the token value of
T_START_HEREDOC and the language_parser.y assigned that to CG(heredoc).
This created a dependency of the lexer on the parser. Thus the
token_get_all() function, which accesses the lexer directly without
also running the parser, was not able to tokenize nested heredoc strings
(and leaked memory). Same applies for the source-code highlighting
functions.
The new approach is to maintain a heredoc_label_stack in the lexer, which
contains all active heredoc labels.
As it is no longer required, T_START_HEREDOC and T_END_HEREDOC now don't
carry a token value anymore.
In order to make the work with zend_ptr_stack in this context more
convenient I added a new function zend_ptr_stack_top(), which retrieves the
top element of the stack (similar to zend_stack_top()).