diff --git a/tests/bug00213-php70-opcache.phpt b/tests/bug00213-php70-opcache.phpt index 593362869..001da631e 100644 --- a/tests/bug00213-php70-opcache.phpt +++ b/tests/bug00213-php70-opcache.phpt @@ -30,11 +30,9 @@ xdebug.overload_var_dump=0 ?> --EXPECT-- 48 -array(5) { +array(4) { [5]=> int(1) - [6]=> - int(-2) [8]=> int(1) [12]=> diff --git a/tests/bug00334-php70-opcache.phpt b/tests/bug00334-php70-opcache.phpt index e3bc45a79..945e5d83e 100644 --- a/tests/bug00334-php70-opcache.phpt +++ b/tests/bug00334-php70-opcache.phpt @@ -34,11 +34,9 @@ array(2) { int(1) } ["%sbug00334.inc"]=> - array(3) { + array(2) { [5]=> int(1) - [7]=> - int(-1) [9]=> int(1) } diff --git a/tests/bug00757b-php7.phpt b/tests/bug00757b-php7.phpt index 41d836f07..05903db83 100644 --- a/tests/bug00757b-php7.phpt +++ b/tests/bug00757b-php7.phpt @@ -1,5 +1,9 @@ --TEST-- -Test for bug #757: XDEBUG_CC_UNUSED does not work with code outside a function. +Test for bug #757: XDEBUG_CC_UNUSED does not work with code outside a function. (< PHP 7.2 || !opcache) +--SKIPIF-- +=') && extension_loaded('zend opcache'))) { echo "skip < PHP 7.2 || !opcache loaded needed\n"; }; +?> --INI-- xdebug.default_enable=1 xdebug.overload_var_dump=0 diff --git a/tests/bug00757b-php72.phpt b/tests/bug00757b-php72.phpt new file mode 100644 index 000000000..6ddb08426 --- /dev/null +++ b/tests/bug00757b-php72.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test for bug #757: XDEBUG_CC_UNUSED does not work with code outside a function (>= PHP 7.2 && opcache) +--SKIPIF-- +=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; }; +?> +--INI-- +xdebug.default_enable=1 +xdebug.overload_var_dump=0 +xdebug.auto_trace=0 +xdebug.trace_options=0 +xdebug.trace_output_dir=/tmp +xdebug.collect_params=1 +xdebug.collect_return=0 +xdebug.collect_assignments=0 +xdebug.auto_profile=0 +xdebug.profiler_enable=0 +xdebug.dump_globals=0 +xdebug.show_mem_delta=0 +xdebug.trace_format=0 +xdebug.extended_info=1 +--FILE-- + +--EXPECT-- +2 +array(8) { + [4]=> + int(1) + [6]=> + int(1) + [7]=> + int(1) + [8]=> + int(1) + [12]=> + int(1) + [13]=> + int(1) + [15]=> + int(1) + [17]=> + int(1) +} diff --git a/tests/bug01247-php72-opcache.phpt b/tests/bug01247-php72-opcache.phpt new file mode 100644 index 000000000..3cb74de08 --- /dev/null +++ b/tests/bug01247-php72-opcache.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test for bug #1247: xdebug.show_local_vars dumps variables with *uninitialized* values (>= PHP 7.2 && opcache) +--SKIPIF-- +=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; }; +?> +--INI-- +xdebug.default_enable=1 +xdebug.collect_params=4 +html_errors=0 +xdebug.dump.GET= +xdebug.dump.POST= +xdebug.show_local_vars=1 +--GET-- +getFoo=bar +--POST-- +postBar=baz +--FILE-- + +--EXPECTF-- +Warning: strtr() expects at least 2 parameters, 0 given in %sbug01247-php72-opcache.php on line 5 + +Call Stack: +%w%f %w%d 1. {main}() %sbug01247-php72-opcache.php:0 +%w%f %w%d 2. test() %sbug01247-php72-opcache.php:20 +%w%f %w%d 3. strtr() %sbug01247-php72-opcache.php:5 + + +Notice: test in %sbug01247-php72-opcache.php on line 14 + +Call Stack: +%w%f %w%d 1. {main}() %sbug01247-php72-opcache.php:0 +%w%f %w%d 2. testDirect() %sbug01247-php72-opcache.php:21 +%w%f %w%d 3. trigger_error('test') %sbug01247-php72-opcache.php:14 diff --git a/tests/bug01247.phpt b/tests/bug01247.phpt index ea1a607d8..ed1ae90c9 100644 --- a/tests/bug01247.phpt +++ b/tests/bug01247.phpt @@ -1,5 +1,9 @@ --TEST-- -Test for bug #1247: xdebug.show_local_vars dumps variables with *uninitialized* values +Test for bug #1247: xdebug.show_local_vars dumps variables with *uninitialized* values (< PHP 7.2 || no opcache) +--SKIPIF-- +=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; }; +?> --INI-- xdebug.default_enable=1 xdebug.collect_params=4 @@ -16,31 +20,31 @@ postBar=baz function test() { $a = 42; - strtr(); - $b = 4; + + return $a + $b; } function testDirect() { $c = 56; - trigger_error('test'); - $d = 11; + + return $c + $d; } test(); testDirect(); ?> --EXPECTF-- -Warning: strtr() expects at least 2 parameters, 0 given in %sbug01247.php on line 6 +Warning: strtr() expects at least 2 parameters, 0 given in %sbug01247.php on line 5 Call Stack: %w%f %w%d 1. {main}() %sbug01247.php:0 %w%f %w%d 2. test() %sbug01247.php:20 -%w%f %w%d 3. strtr() %sbug01247.php:6 +%w%f %w%d 3. strtr() %sbug01247.php:5 Variables in local scope (#2): @@ -48,12 +52,12 @@ Variables in local scope (#2): $b = *uninitialized* -Notice: test in %sbug01247.php on line 15 +Notice: test in %sbug01247.php on line 14 Call Stack: %w%f %w%d 1. {main}() %sbug01247.php:0 %w%f %w%d 2. testDirect() %sbug01247.php:21 -%w%f %w%d 3. trigger_error('test') %sbug01247.php:15 +%w%f %w%d 3. trigger_error('test') %sbug01247.php:14 Variables in local scope (#2): diff --git a/tests/bug01270-php714-opcache.phpt b/tests/bug01270-php714-opcache.phpt index 1b2abb892..f525d26bd 100644 --- a/tests/bug01270-php714-opcache.phpt +++ b/tests/bug01270-php714-opcache.phpt @@ -1,7 +1,8 @@ --TEST-- -Test for bug #1270: String parsing marked not covered (> PHP 7.1.3) +Test for bug #1270: String parsing marked not covered (> PHP 7.1.3; < PHP 7.2) --SKIPIF-- -')) echo "skip > PHP 7.1.3 needed\n"; ?> +')) echo "skip > PHP 7.1.3; < PHP 7.2 needed\n"; ?> + PHP 7.1.3; < PHP 7.2 needed\n"; ?> --FILE-- = PHP 7.2) +--SKIPIF-- +=')) echo "skip >= PHP 7.2 needed\n"; ?> + +--FILE-- + +--EXPECTF-- +array(1) { + ["%sbug01270.inc"]=> + array(13) { + [2]=> + int(1) + [4]=> + int(1) + [5]=> + int(1) + [7]=> + int(1) + [11]=> + int(1) + [13]=> + int(1) + [14]=> + int(1) + [16]=> + int(1) + [20]=> + int(1) + [22]=> + int(1) + [23]=> + int(1) + [27]=> + int(1) + [33]=> + int(1) + } +} diff --git a/tests/bug01386-php70-opcache.phpt b/tests/bug01386-php70-opcache.phpt index a33431a24..4d16b8d34 100644 --- a/tests/bug01386-php70-opcache.phpt +++ b/tests/bug01386-php70-opcache.phpt @@ -40,7 +40,7 @@ xdebug_stop_code_coverage(false); --EXPECTF-- array(2) { ["%sbug01386-class1.inc"]=> - array(6) { + array(5) { [3]=> int(1) [7]=> @@ -49,13 +49,11 @@ array(2) { int(-1) [9]=> int(-1) - [10]=> - int(-2) [13]=> int(1) } ["%sbug01386-class2.inc"]=> - array(6) { + array(5) { [3]=> int(1) [7]=> @@ -64,8 +62,6 @@ array(2) { int(-1) [9]=> int(-1) - [10]=> - int(-2) [13]=> int(1) } diff --git a/tests/xdebug_debug_zval-php71-nts-opcache.phpt b/tests/xdebug_debug_zval-php71-nts-opcache.phpt index 6e311e478..1f1ff3172 100644 --- a/tests/xdebug_debug_zval-php71-nts-opcache.phpt +++ b/tests/xdebug_debug_zval-php71-nts-opcache.phpt @@ -1,9 +1,10 @@ --TEST-- -Test for xdebug_debug_zval() (>= PHP 7.1, NTS, opcache) +Test for xdebug_debug_zval() (>= PHP 7.1, < PHP 7.2, NTS, opcache) --SKIPIF-- =')) echo "skip >= PHP 7.1 needed\n"; +if (!version_compare(phpversion(), "7.1", '>=')) echo "skip >= PHP 7.1, < PHP 7.2 needed\n"; +if (!version_compare(phpversion(), "7.2", '<')) echo "skip >= PHP 7.1, < PHP 7.2 needed\n"; if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; ?> --INI-- diff --git a/tests/xdebug_debug_zval_cli_color-php71-nts-opcache.phpt b/tests/xdebug_debug_zval_cli_color-php71-nts-opcache.phpt index d5ec05ddd..818f62341 100644 --- a/tests/xdebug_debug_zval_cli_color-php71-nts-opcache.phpt +++ b/tests/xdebug_debug_zval_cli_color-php71-nts-opcache.phpt @@ -1,9 +1,10 @@ --TEST-- -Test for xdebug_debug_zval() (CLI colours) (>= PHP 7.1, NTS, opcache) +Test for xdebug_debug_zval() (CLI colours) (>= PHP 7.1, < PHP 7.2, NTS, opcache) --SKIPIF-- =')) echo "skip >= PHP 7.1 needed\n"; +if (!version_compare(phpversion(), "7.1", '>=')) echo "skip >= PHP 7.1, < PHP 7.2 needed\n"; +if (!version_compare(phpversion(), "7.2", '<')) echo "skip >= PHP 7.1, < PHP 7.2 needed\n"; if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; ?> --INI-- diff --git a/tests/xdebug_debug_zval_stdout-php71-nts-opcache.phpt b/tests/xdebug_debug_zval_stdout-php71-nts-opcache.phpt index 26171a3de..b679ddc00 100644 --- a/tests/xdebug_debug_zval_stdout-php71-nts-opcache.phpt +++ b/tests/xdebug_debug_zval_stdout-php71-nts-opcache.phpt @@ -1,9 +1,10 @@ --TEST-- -Test for xdebug_debug_zval_stdout() (>= PHP 7.1, NTS, opcache) +Test for xdebug_debug_zval_stdout() (>= PHP 7.1, PHP < 7.2, NTS, opcache) --SKIPIF-- =')) echo "skip >= PHP 7.1 needed\n"; +if (!version_compare(phpversion(), "7.1", '>=')) echo "skip >= PHP 7.1, < PHP 7.2 needed\n"; +if (!version_compare(phpversion(), "7.2", '<')) echo "skip >= PHP 7.1, < PHP 7.2 needed\n"; if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; ?> --INI--