1
0
Fork 0

decompiler: fix argument default value

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@736 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 2011-04-10 14:38:36 +00:00
parent 86749b6e64
commit 8d18908346
2 changed files with 25 additions and 10 deletions

View File

@ -1557,17 +1557,18 @@ class Decompiler
if ($i) {
echo ', ';
}
$arg = $EX['recvs'][$i + 1];
if (isset($op_array['arg_info'])) {
$ai = $op_array['arg_info'][$i];
if (!empty($ai['class_name'])) {
echo $ai['class_name'], ' ';
if ($ai['allow_null']) {
if (!ZEND_ENGINE_2_2 && $ai['allow_null']) {
echo 'or NULL ';
}
}
else if (!empty($ai['array_type_hint'])) {
echo 'array ';
if ($ai['allow_null']) {
if (!ZEND_ENGINE_2_2 && $ai['allow_null']) {
echo 'or NULL ';
}
}
@ -1596,11 +1597,10 @@ class Decompiler
assert(0);
}
}
$arg = $EX['recvs'][$i + 1];
echo toCode($arg[0], $indent);
if (isset($arg[1])) {
echo ' = ', toCode($arg[1], $indent);
}
}
if (isset($arg[1])) {
echo ' = ', toCode($arg[1], $indent);
}
}
}

View File

@ -2,39 +2,54 @@
class ClassName
{
/** doc */
static public $static = array(
array('array'),
'str'
);
/** doc */
static public $public_static = array(2, 'str');
/** doc */
static private $private_static = array(2, 'str');
/** doc */
static protected $protected_static = array(2, 'str');
/** doc */
public $property = array(
array('array'),
'str'
);
/** doc */
public $public_property = array(2, 'str');
/** doc */
private $private_property = array(2, 'str');
/** doc */
protected $protected_property = array(2, 'str');
/** doc */
public function __construct($a, $b)
{
}
function method(ClassName $a = null, $b = null)
/** doc */
public function method(array $a = NULL, $b = NULL)
{
}
public function publicMethod(ClassName $a = null, $b = 2)
/** doc */
public function publicMethod(ClassName $a = NULL, $b = 2)
{
}
protected function protectedMethod(ClassName $a, $b = array(array("array")))
/** doc */
protected function protectedMethod(ClassName $a, $b = array(
array('array')
))
{
return 'protected';
}
private function privateMethod(ClassName $a, $b = null)
/** doc */
private function privateMethod(ClassName $a, $b = NULL)
{
return 'private';
}