Changeset 751 for trunk


Ignore:
Timestamp:
2011-04-17T06:00:31+02:00 (4 years ago)
Author:
moo
Message:

decompiler: improvements late binding function, sample code organize

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Decompiler.class.php

    r750 r751  
    12761276                    }
    12771277                    $class = &$this->dc['class_table'][$key];
    1278                     $class['name'] = unquoteName($this->getOpVal($op2, $EX), $EX);
     1278                    if (!isset($class['name'])) {
     1279                        $class['name'] = unquoteName($this->getOpVal($op2, $EX), $EX);
     1280                    }
    12791281                    if ($opc == XC_DECLARE_INHERITED_CLASS || $opc == XC_DECLARE_INHERITED_CLASS_DELAYED) {
    12801282                        $ext /= XC_SIZEOF_TEMP_VARIABLE;
     
    15631565                case XC_EXT_FCALL_END:
    15641566                case XC_EXT_NOP:
     1567                    break;
     1568                case XC_DECLARE_FUNCTION:
     1569                    $this->dfunction($this->dc['function_table'][$op1['constant']], $EX['indent']);
    15651570                    break;
    15661571                case XC_DECLARE_LAMBDA_FUNCTION:
  • trunk/decompilesample.php

    r750 r751  
    9090function f1($f)
    9191{
     92    echo __FUNCTION__;
    9293    echo $f;
    9394}
     
    149150}
    150151
     152if ($late) {
     153class LateBindingClass
     154{}
     155
     156function lateBindingFunction($arg)
     157{
     158    echo 'lateFunction';
     159}
     160}
     161
    151162echo "\r\n";
    152163echo "\r";
     
    155166$object = new ClassName();
    156167$object = new $className();
    157 try {
    158     echo 'code being try';
    159 }
    160 catch (Exception $e) {
    161     echo $e;
    162 }
     168$result = $object instanceof ClassName;
    163169$cloned = clone $object;
    164170$a = 1;
     
    192198$a = $obj->b--;
    193199$a = --$obj->b;
     200$a = $b xor $c;
     201$a = !$b;
    194202$a = $b and $c;
    195203$a = $b or $c;
    196 $a = $b xor $c;
    197 $a = !$b;
    198204$a = $b && $c;
    199205$a = $b || $c;
    200206$a = $b ? $c : $d;
    201207$a = f1() ? f2() : f3();
    202 $a = $b instanceof ClassName;
     208
     209try {
     210    echo 'outer try 1';
     211    try {
     212        echo 'inner try';
     213    }
     214    catch (InnerException $e) {
     215        echo $e;
     216    }
     217    echo 'outer try 2';
     218}
     219catch (OuterException $e) {
     220    echo $e;
     221}
    203222
    204223if ($a) {
     
    253272include 'include.php';
    254273include_once 'include_once.php';
     274echo __FILE__;
     275echo __LINE__;
    255276
    256277//* >= PHP 5.3
Note: See TracChangeset for help on using the changeset viewer.