b0y-101 Mini Shell


Current Path : E:/www/b-group.old/spfin/phppayment/src/xdebug/tests/develop/
File Upload :
Current File : E:/www/b-group.old/spfin/phppayment/src/xdebug/tests/develop/bug02041.phpt

--TEST--
Test for bug #2041: __debugInfo is not used for var_dump output
--FILE--
<?php
final class X
{
    private $secretValue;

    public function __construct(string $secretValue)
    {
        $this->secretValue = $secretValue;
    }

    public function __debugInfo()
    {
        $properties = get_object_vars($this);
        $properties['secretValue'] = empty($properties['secretValue']) ? '' : '********';
        return $properties;
    }
}

$a = new X('supersecret');
var_dump($a);
?>
--EXPECTF--
object(X)#1 (%d) {
  ["secretValue"]=>
  string(8) "********"
}

Copyright © 2019 by b0y-101