mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fixed bug #66474 (Optimizer bug in constant string to boolean conversion) Conflicts: NEWS
This commit is contained in:
commit
d09d64c15c
@ -1057,6 +1057,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
|
||||
/* BOOL */
|
||||
result = ZEND_OP1_LITERAL(opline);
|
||||
convert_to_boolean(&result);
|
||||
Z_TYPE(ZEND_OP1_LITERAL(opline)) = IS_NULL;
|
||||
}
|
||||
PZ_SET_REFCOUNT_P(&result, 1);
|
||||
PZ_UNSET_ISREF_P(&result);
|
||||
|
18
ext/opcache/tests/bug66474.phpt
Normal file
18
ext/opcache/tests/bug66474.phpt
Normal file
@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #66474 (Optimizer bug in constant string to boolean conversion)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.file_update_protection=0
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
$speed = 'slow' || 'fast';
|
||||
}
|
||||
foo();
|
||||
echo "ok\n";
|
||||
--EXPECT--
|
||||
ok
|
Loading…
Reference in New Issue
Block a user