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:
Dmitry Stogov 2014-01-13 12:07:50 +04:00
commit d09d64c15c
2 changed files with 19 additions and 0 deletions

View File

@ -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);

View 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