]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorDmitry Stogov <dmitry@zend.com>
Mon, 18 Nov 2019 08:29:38 +0000 (11:29 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 18 Nov 2019 08:29:38 +0000 (11:29 +0300)
* PHP-7.4:
  Fix $x = (bool)$x; for undefined with opcache

1  2 
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/opcache/tests/bool_not_cv.phpt

Simple merge
Simple merge
index 0000000000000000000000000000000000000000,ed3cf83514707b40691bb57eda946b5c73f447b2..cc28edcc01fe10276112f6feee68f1a5b25a85dc
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,34 +1,34 @@@
 -Notice: Undefined variable: v in %s on line 4
+ --TEST--
+ $v = !$v/(bool)$v checks for undefined variables
+ --INI--
+ opcache.enable=1
+ opcache.enable_cli=1
+ opcache.file_cache_only=0
+ --SKIPIF--
+ <?php require_once('skipif.inc'); ?>
+ --FILE--
+ <?php
+ function undef_negation() {
+     echo "In undef_negation\n";
+     $v = !$v;
+     var_export($v);
+     echo "\n";
+ }
+ function undef_bool_cast() {
+     echo "In undef_bool_cast\n";
+     $v = (bool)$v;
+     var_export($v);
+     echo "\n";
+ }
+ undef_negation();
+ undef_bool_cast();
+ ?>
+ --EXPECTF--
+ In undef_negation
 -Notice: Undefined variable: v in %s on line 10
++Warning: Undefined variable: v in %s on line 4
+ true
+ In undef_bool_cast
++Warning: Undefined variable: v in %s on line 10
+ false