Skip to content
Permalink
Browse files

Merged pull request #537

  • Loading branch information
derickr committed Jan 10, 2020
2 parents 774838d + 615aedf commit 3f0e9a5775af6c6f527b96b52590cfc1fb577038
@@ -3,7 +3,6 @@ sudo: false
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3
@@ -187,7 +187,7 @@ Mon, Dec 9, 2019 - xdebug 2.9.0
<dependencies>
<required>
<php>
<min>7.0.0</min>
<min>7.1.0</min>
</php>
<pearinstaller>
<min>1.9.1</min>
@@ -2416,12 +2416,12 @@ function settings2params(&$ini_settings)
$settings .= " -d \"$name=$val\"";
}
} else {
if (substr(PHP_OS, 0, 3) == "WIN" && !empty($value) && is_string($value) && $value{0} == '"') {
if (substr(PHP_OS, 0, 3) == "WIN" && !empty($value) && is_string($value) && $value[0] == '"') {
$len = strlen($value);

if ($value{$len - 1} == '"') {
$value{0} = "'";
$value{$len - 1} = "'";
if ($value[$len - 1] == '"') {
$value[0] = "'";
$value[$len - 1] = "'";
}
} else {
$value = addslashes($value);
@@ -1023,6 +1023,7 @@ void xdebug_coverage_minit(INIT_FUNC_ARGS)
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_EXT_STMT);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_SEND_VAR);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_SEND_VAR_NO_REF);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_SEND_VAR_NO_REF_EX);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_SEND_REF);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_SEND_VAL);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_SEND_VAL_EX);
@@ -1134,6 +1135,7 @@ void xdebug_coverage_mshutdown(void)
zend_set_user_opcode_handler(ZEND_EXT_STMT, NULL);
zend_set_user_opcode_handler(ZEND_SEND_VAR, NULL);
zend_set_user_opcode_handler(ZEND_SEND_VAR_NO_REF, NULL);
zend_set_user_opcode_handler(ZEND_SEND_VAR_NO_REF_EX, NULL);
zend_set_user_opcode_handler(ZEND_SEND_REF, NULL);
zend_set_user_opcode_handler(ZEND_SEND_VAL, NULL);
zend_set_user_opcode_handler(ZEND_SEND_VAL_EX, NULL);
@@ -0,0 +1,17 @@
<?php
namespace FancyNamespace;

class ConfigProvider
{
public function test()
{
return array_merge(
require(__DIR__ . '/bug01733a.inc'),
require(__DIR__ . '/bug01733a.inc')
);
}
}

$c = new ConfigProvider;
var_dump( $c->test() );
?>
@@ -0,0 +1,28 @@
--TEST--
Test for bug #1733: SEND_VAR_NO_REF_EX opcode, used for require() in namespace, is not overloaded
--INI--
xdebug.coverage_enable=1
--FILE--
<?php
require __DIR__ . '/../utils.inc';

xdebug_start_code_coverage( XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE );

include dirname( __FILE__ ) . '/bug01733.inc';

$cc = xdebug_get_code_coverage();

ksort( $cc );
$fileInfo = array_values( array_slice( $cc, 0, 1 ) )[0];
mustBeExecuted( $fileInfo, range( 8, 10 ) );
?>
--EXPECTF--
array(2) {
[0]=>
string(%d) "%s"
[1]=>
string(%d) "%s"
}
line #8 is present and covered
line #9 is present and covered
line #10 is present and covered
@@ -0,0 +1,3 @@
<?php
return [ rand() => __FILE__ ];
?>

0 comments on commit 3f0e9a5

Please sign in to comment.
You can’t perform that action at this time.