decompiler: dirty improvement for \r\n
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@750 c26eb9a1-5813-0410-bd6c-c2e55f420ca73.0
parent
cccdfd61aa
commit
80f0bd32d7
|
@ -107,7 +107,21 @@ class Decompiler_Value extends Decompiler_Object // {{{
|
|||
|
||||
function toCode($indent)
|
||||
{
|
||||
return var_export($this->value, true);
|
||||
$code = var_export($this->value, true);
|
||||
if (gettype($this->value) == 'string') {
|
||||
switch ($this->value) {
|
||||
case "\r":
|
||||
return '"\\r"';
|
||||
case "\n":
|
||||
return '"\\n"';
|
||||
case "\r\n":
|
||||
return '"\\r\\n"';
|
||||
}
|
||||
$code = str_replace("\r\n", '\' . "\\r\\n" . \'', $code);
|
||||
$code = str_replace("\r", '\' . "\\r" . \'', $code);
|
||||
$code = str_replace("\n", '\' . "\\n" . \'', $code);
|
||||
}
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
// }}}
|
||||
|
|
|
@ -148,6 +148,9 @@ final class Child extends ClassName implements IInterface
|
|||
}
|
||||
}
|
||||
|
||||
echo "\r\n";
|
||||
echo "\r";
|
||||
echo "\n";
|
||||
echo str_replace(array('a' => 'a', 'b' => 'c'), 'b');
|
||||
$object = new ClassName();
|
||||
$object = new $className();
|
||||
|
|
Loading…
Reference in New Issue