Changeset 739 for branches/1.3/Decompiler.class.php
- Timestamp:
- 2011-04-11T06:46:16+02:00 (2 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Decompiler.class.php (modified) (54 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/Decompiler.class.php
r728 r739 9 9 } 10 10 11 function str($src, $indent = '') // {{{ 11 function str($code, $indent = '') // {{{ 12 { 13 if (is_object($code)) { 14 if (get_class($code) != 'Decompiler_Code') { 15 $code = toCode($code, $indent); 16 } 17 return $code->__toString(); 18 } 19 20 return (string) $code; 21 } 22 // }}} 23 function toCode($src, $indent = '') // {{{ 12 24 { 13 25 if (is_array($indent)) { … … 15 27 } 16 28 17 /*18 $e = xcache_get_special_value($src);19 if (isset($e)) {20 if (is_array($e)) {21 $src = $e;22 }23 else {24 return $e;25 }26 }27 */28 29 if (is_array($src)) {30 exit('array str');31 $src = new Decompiler_Array($src, $indent);32 return $src->__toString();33 }34 35 29 if (is_object($src)) { 36 if (!method_exists($src, ' __toString')) {30 if (!method_exists($src, 'toCode')) { 37 31 var_dump($src); 38 exit('no __toString');39 } 40 return $src->__toString();41 } 42 43 return $src;32 exit('no toCode'); 33 } 34 return new Decompiler_Code($src->toCode($indent)); 35 } 36 37 return new Decompiler_Code($src); 44 38 } 45 39 // }}} … … 55 49 } 56 50 57 if ( $value instanceof Decompiler_Object) {51 if (is_a($value, 'Decompiler_Object')) { 58 52 // use as is 59 53 } 60 54 else if (is_array($value)) { 61 $value = new Decompiler_ Array($value);55 $value = new Decompiler_ConstArray($value); 62 56 } 63 57 else { … … 80 74 } 81 75 82 function __toString()76 function toCode($indent) 83 77 { 84 78 return var_export($this->value, true); … … 93 87 { 94 88 $this->src = $src; 89 } 90 91 function toCode($indent) 92 { 93 return $this; 95 94 } 96 95 … … 107 106 var $op2; 108 107 var $parent; 108 var $indent; 109 109 110 110 function Decompiler_Binop($parent, $op1, $opc, $op2) … … 116 116 } 117 117 118 function __toString()119 { 120 $op1 = str($this->op1);118 function toCode($indent) 119 { 120 $op1 = toCode($this->op1, $indent); 121 121 if (is_a($this->op1, 'Decompiler_Binop') && $this->op1->opc != $this->opc) { 122 122 $op1 = "($op1)"; … … 124 124 $opstr = $this->parent->binops[$this->opc]; 125 125 if ($op1 == '0' && $this->opc == XC_SUB) { 126 return $opstr . str($this->op2);127 } 128 return $op1 . ' ' . $opstr . ' ' . str($this->op2);126 return $opstr . toCode($this->op2, $indent); 127 } 128 return $op1 . ' ' . $opstr . ' ' . toCode($this->op2, $indent); 129 129 } 130 130 } … … 142 142 } 143 143 144 function __toString()144 function toCode($indent) 145 145 { 146 146 switch ($this->fetchType) { … … 168 168 } 169 169 170 function __toString()171 { 172 return $this->obj-> __toString();170 function toCode($indent) 171 { 172 return $this->obj->toCode($indent); 173 173 } 174 174 } … … 180 180 var $assign = null; 181 181 182 function __toString()182 function toCode($indent) 183 183 { 184 184 if (is_a($this->value, 'Decompiler_ListBox')) { 185 $exp = str($this->value->obj->src);185 $exp = toCode($this->value->obj->src, $indent); 186 186 } 187 187 else { 188 $exp = str($this->value);188 $exp = toCode($this->value, $indent); 189 189 } 190 190 foreach ($this->offsets as $dim) { 191 $exp .= '[' . str($dim) . ']';191 $exp .= '[' . toCode($dim, $indent) . ']'; 192 192 } 193 193 return $exp; … … 205 205 var $everLocked = false; 206 206 207 function __toString()207 function toCode($indent) 208 208 { 209 209 if (count($this->dims) == 1 && !$this->everLocked) { … … 212 212 $dim->value = $this->src; 213 213 if (!isset($dim->assign)) { 214 return str($dim);215 } 216 return str($this->dims[0]->assign) . ' = ' . str($dim);214 return toCode($dim, $indent); 215 } 216 return toCode($this->dims[0]->assign, $indent) . ' = ' . toCode($dim, $indent); 217 217 } 218 218 /* flatten dims */ … … 223 223 $assign = &$assign[$offset]; 224 224 } 225 $assign = str($dim->assign);226 } 227 return $this->toList($assigns) . ' = ' . str($this->src);225 $assign = toCode($dim->assign, $indent); 226 } 227 return $this->toList($assigns) . ' = ' . toCode($this->src, $indent); 228 228 } 229 229 … … 260 260 class Decompiler_Array extends Decompiler_Value // {{{ 261 261 { 262 var $indent = ''; 263 264 function Decompiler_Array($value = array(), $indent = '') 265 { 266 $this->value = $value; 267 $this->indent = $indent; 268 } 269 270 function __toString() 271 { 262 // emenets 263 function Decompiler_Array() 264 { 265 $this->value = array(); 266 } 267 268 function toCode($indent) 269 { 270 $subindent = $indent . INDENT; 271 272 $elementsCode = array(); 273 $index = 0; 274 foreach ($this->value as $element) { 275 list($key, $value) = $element; 276 if (!isset($key)) { 277 $key = $index++; 278 } 279 $elementsCode[] = array(str($key, $subindent), str($value, $subindent), $key, $value); 280 } 281 272 282 $exp = "array("; 273 $indent = $ this->indent . INDENT;274 $assoc len= 0;283 $indent = $indent . INDENT; 284 $assocWidth = 0; 275 285 $multiline = 0; 276 286 $i = 0; 277 foreach ($this->value as $k => $v) { 278 if ($i !== $k) { 279 $len = strlen($k); 280 if ($assoclen < $len) { 281 $assoclen = $len; 282 } 283 } 284 if (is_array($v)) { 287 foreach ($elementsCode as $element) { 288 list($keyCode, $valueCode) = $element; 289 if ((string) $i !== $keyCode) { 290 $assocWidth = 1; 291 break; 292 } 293 ++$i; 294 } 295 foreach ($elementsCode as $element) { 296 list($keyCode, $valueCode, $key, $value) = $element; 297 if ($assocWidth) { 298 $len = strlen($keyCode); 299 if ($assocWidth < $len) { 300 $assocWidth = $len; 301 } 302 } 303 if (is_array($value) || is_a($value, 'Decompiler_Array')) { 285 304 $multiline ++; 286 305 } 287 ++ $i;288 }289 if ($assoclen) {290 $assoclen += 2;291 306 } 292 307 293 308 $i = 0; 294 $subindent = $indent . INDENT;295 foreach ($this->value as $k => $v) {309 foreach ($elementsCode as $element) { 310 list($keyCode, $value) = $element; 296 311 if ($multiline) { 297 312 if ($i) { … … 307 322 } 308 323 309 $k = var_export($k, true); 310 if ($multiline) { 311 $exp .= sprintf("%{$assoclen}s => ", $k); 312 } 313 else if ($assoclen) { 314 $exp .= $k . ' => '; 315 } 316 317 $exp .= str(value($v), $subindent); 324 if ($assocWidth) { 325 if ($multiline) { 326 $exp .= sprintf("%-{$assocWidth}s => ", $keyCode); 327 } 328 else { 329 $exp .= $keyCode . ' => '; 330 } 331 } 332 333 $exp .= $value; 318 334 319 335 $i ++; 320 336 } 321 337 if ($multiline) { 322 $exp .= " $indent);";338 $exp .= "\n$indent)"; 323 339 } 324 340 else { … … 326 342 } 327 343 return $exp; 344 } 345 } 346 // }}} 347 class Decompiler_ConstArray extends Decompiler_Array // {{{ 348 { 349 function Decompiler_ConstArray($array) 350 { 351 $elements = array(); 352 foreach ($array as $key => $value) { 353 $elements[] = array(value($key), value($value)); 354 } 355 $this->value = $elements; 328 356 } 329 357 } … … 333 361 var $iskey; 334 362 335 function __toString()363 function toCode($indent) 336 364 { 337 365 return 'foreach (' . ''; … … 417 445 $curticks = $toticks; 418 446 } 419 echo $indent, str($op['php']), ";\n";447 echo $indent, toCode($op['php'], $indent), ";\n"; 420 448 } 421 449 } … … 429 457 switch ($op['op_type']) { 430 458 case XC_IS_CONST: 431 return str(value($op['constant']));459 return toCode(value($op['constant']), $EX); 432 460 433 461 case XC_IS_VAR: … … 436 464 $ret = $T[$op['var']]; 437 465 if ($tostr) { 438 $ret = str($ret, $EX);466 $ret = toCode($ret, $EX); 439 467 } 440 468 if ($free) { … … 466 494 } 467 495 // }}} 468 function &dop_array($op_array, $indent = '') // {{{ 469 { 470 $opcodes = &$op_array['opcodes']; 471 $last = count($opcodes) - 1; 472 if ($opcodes[$last]['opcode'] == XC_HANDLE_EXCEPTION) { 473 unset($opcodes[$last]); 474 } 475 $EX['indent'] = ''; 496 function &fixOpcode($opcodes, $removeTailing = false, $defaultReturnValue = null) // {{{ 497 { 476 498 for ($i = 0, $cnt = count($opcodes); $i < $cnt; $i ++) { 477 499 if (function_exists('xcache_get_fixed_opcode')) { … … 505 527 } 506 528 } 529 530 if ($removeTailing) { 531 $last = count($opcodes) - 1; 532 if ($opcodes[$last]['opcode'] == XC_HANDLE_EXCEPTION) { 533 unset($opcodes[$last]); 534 --$last; 535 } 536 if ($opcodes[$last]['opcode'] == XC_RETURN) { 537 $op1 = $opcodes[$last]['op1']; 538 if ($op1['op_type'] == XC_IS_CONST && array_key_exists('constant', $op1) && $op1['constant'] === $defaultReturnValue) { 539 unset($opcodes[$last]); 540 --$last; 541 } 542 } 543 } 544 return $opcodes; 545 } 546 // }}} 547 function &dop_array($op_array, $indent = '') // {{{ 548 { 549 $op_array['opcodes'] = $this->fixOpcode($op_array['opcodes'], true, $indent == '' ? 1 : null); 550 $opcodes = &$op_array['opcodes']; 551 $EX['indent'] = ''; 507 552 // {{{ build jmp array 508 553 for ($i = 0, $cnt = count($opcodes); $i < $cnt; $i ++) { … … 633 678 $body = ob_get_clean(); 634 679 635 $as = str($op['fe_as']);680 $as = toCode($op['fe_as'], $EX); 636 681 if (isset($op['fe_key'])) { 637 $as = str($op['fe_key']) . ' => ' . $as;638 } 639 echo "{$indent}foreach (" . str($op['fe_src']) . " as $as) {\n";682 $as = toCode($op['fe_key'], $EX) . ' => ' . $as; 683 } 684 echo "{$indent}foreach (" . toCode($op['fe_src'], $EX) . " as $as) {\n"; 640 685 echo $body; 641 686 echo "{$indent}}"; … … 757 802 758 803 $resvar = null; 759 if ( isset($res['EA.type']) && ($res['EA.type'] & EXT_TYPE_UNUSED) || $res['op_type'] == XC_IS_UNUSED) {804 if ((ZEND_ENGINE_2_4 ? ($res['op_type'] & EXT_TYPE_UNUSED) : ($res['EA.type'] & EXT_TYPE_UNUSED)) || $res['op_type'] == XC_IS_UNUSED) { 760 805 $istmpres = false; 761 806 } … … 791 836 $EX['called_scope'] = null; 792 837 $EX['fbc'] = 'new ' . $this->unquoteName($this->getOpVal($op1, $EX)); 793 if ( PHP_VERSION < 5) {838 if (!ZEND_ENGINE_2) { 794 839 $resvar = '$new object$'; 795 840 } … … 798 843 case XC_FETCH_CLASS: // {{{ 799 844 if ($op2['op_type'] == XC_IS_UNUSED) { 800 switch ( $ext) {845 switch (($ext & (defined('ZEND_FETCH_CLASS_MASK') ? ZEND_FETCH_CLASS_MASK : 0xFF))) { 801 846 case ZEND_FETCH_CLASS_SELF: 802 847 $class = 'self'; … … 843 888 case XC_UNSET_VAR: 844 889 $rvalue = $this->getOpVal($op1, $EX); 845 $fetchtype = $op2[PHP_VERSION < 5 ? 'fetch_type' : 'EA.type']; 890 if (defined('ZEND_FETCH_TYPE_MASK')) { 891 $fetchtype = ($ext & ZEND_FETCH_TYPE_MASK); 892 } 893 else { 894 $fetchtype = $op2[!ZEND_ENGINE_2 ? 'fetch_type' : 'EA.type']; 895 } 846 896 switch ($fetchtype) { 847 897 case ZEND_FETCH_STATIC_MEMBER: … … 856 906 } 857 907 if ($opc == XC_UNSET_VAR) { 858 $op['php'] = "unset(" . str($rvalue) . ")";908 $op['php'] = "unset(" . toCode($rvalue, $EX) . ")"; 859 909 $lastphpop = &$op; 860 910 } … … 917 967 ++ $i; 918 968 $rvalue = $this->getOpVal($opcodes[$i]['op1'], $EX); 919 $resvar = str($lvalue) . ' = ' . $rvalue;969 $resvar = toCode($lvalue, $EX) . ' = ' . $rvalue; 920 970 } 921 971 else if ($opc == XC_UNSET_DIM) { 922 $op['php'] = "unset(" . str($rvalue) . ")";972 $op['php'] = "unset(" . toCode($rvalue, $EX) . ")"; 923 973 $lastphpop = &$op; 924 974 } … … 941 991 $dim->assign = $lvalue; 942 992 if ($dim->isLast) { 943 $resvar = str($dim->value);993 $resvar = toCode($dim->value, $EX); 944 994 } 945 995 unset($dim); 946 996 break; 947 997 } 948 $resvar = "$lvalue = " . str($rvalue, $EX);998 $resvar = "$lvalue = " . toCode($rvalue, $EX); 949 999 break; 950 1000 // }}} … … 953 1003 $rvalue = $this->getOpVal($op2, $EX, false); 954 1004 if (is_a($rvalue, 'Decompiler_Fetch')) { 955 $src = str($rvalue->src);1005 $src = toCode($rvalue->src, $EX); 956 1006 if (substr($src, 1, -1) == substr($lvalue, 1)) { 957 1007 switch ($rvalue->fetchType) { 958 1008 case ZEND_FETCH_GLOBAL: 1009 case ZEND_FETCH_GLOBAL_LOCK: 959 1010 $resvar = 'global ' . $lvalue; 960 1011 break 2; … … 966 1017 $var = $statics[$name]; 967 1018 $resvar .= ' = '; 968 $resvar .= str(value($var), $EX);1019 $resvar .= toCode(value($var), $EX); 969 1020 } 970 1021 unset($statics); 971 1022 break 2; 1023 default: 972 1024 } 973 1025 } 974 1026 } 975 $rvalue = str($rvalue); 1027 // TODO: PHP_6 global 1028 $rvalue = toCode($rvalue, $EX); 976 1029 $resvar = "$lvalue = &$rvalue"; 977 1030 break; … … 1018 1071 } 1019 1072 else { 1020 $rvalue = "${" . $rvalue . "}";1073 $rvalue = '${' . $rvalue . '}'; 1021 1074 } 1022 1075 if ($op2['EA.type'] == ZEND_FETCH_STATIC_MEMBER) { … … 1044 1097 } 1045 1098 1046 switch (( PHP_VERSION < 5? $op['op2']['var'] /* constant */ : $ext) & (ZEND_ISSET|ZEND_ISEMPTY)) {1099 switch ((!ZEND_ENGINE_2 ? $op['op2']['var'] /* constant */ : $ext) & (ZEND_ISSET|ZEND_ISEMPTY)) { 1047 1100 case ZEND_ISSET: 1048 1101 $rvalue = "isset($rvalue)"; … … 1186 1239 switch ($opc) { 1187 1240 case XC_ADD_CHAR: 1188 $op2val = str(chr($op2val), $EX);1241 $op2val = toCode(chr($op2val), $EX); 1189 1242 break; 1190 1243 case XC_ADD_STRING: 1191 $op2val = str($op2val, $EX);1244 $op2val = toCode($op2val, $EX); 1192 1245 break; 1193 1246 case XC_ADD_VAR: … … 1226 1279 1227 1280 if ($opc == XC_ADD_ARRAY_ELEMENT) { 1228 $ offset= $this->getOpVal($op2, $EX);1229 if (isset($ offset)) {1230 $T[$res['var']]->value[ $offset] = $rvalue;1281 $assoc = $this->getOpVal($op2, $EX); 1282 if (isset($assoc)) { 1283 $T[$res['var']]->value[] = array($assoc, $rvalue); 1231 1284 } 1232 1285 else { 1233 $T[$res['var']]->value[] = $rvalue;1286 $T[$res['var']]->value[] = array(null, $rvalue); 1234 1287 } 1235 1288 } … … 1242 1295 } 1243 1296 1244 $ offset= $this->getOpVal($op2, $EX);1245 if (isset($ offset)) {1246 $resvar->value[ $offset] = $rvalue;1297 $assoc = $this->getOpVal($op2, $EX); 1298 if (isset($assoc)) { 1299 $resvar->value[] = array($assoc, $rvalue); 1247 1300 } 1248 1301 else { 1249 $resvar->value[] = $rvalue;1302 $resvar->value[] = array(null, $rvalue); 1250 1303 } 1251 1304 } … … 1329 1382 $targetop = &$EX['opcodes'][$op2['opline_num']]; 1330 1383 if ($opc == XC_JMPNZ_EX) { 1331 $targetop['cond_true'][] = str($rvalue);1384 $targetop['cond_true'][] = toCode($rvalue, $EX); 1332 1385 } 1333 1386 else { 1334 $targetop['cond_false'][] = str($rvalue);1387 $targetop['cond_false'][] = toCode($rvalue, $EX); 1335 1388 } 1336 1389 unset($targetop); … … 1360 1413 $default = null; 1361 1414 } 1362 $EX['recvs'][ $offset] = array($lvalue, $default);1415 $EX['recvs'][str($offset)] = array($lvalue, $default); 1363 1416 break; 1364 1417 case XC_POST_DEC: … … 1400 1453 case XC_END_SILENCE: // {{{ 1401 1454 $EX['silence'] --; 1402 $lastresvar = '@' . str($lastresvar);1455 $lastresvar = '@' . toCode($lastresvar, $EX); 1403 1456 break; 1404 1457 // }}} … … 1470 1523 $a = array_pop($EX['argstack']); 1471 1524 if (is_array($a)) { 1472 array_unshift($args, str($a, $EX));1525 array_unshift($args, toCode($a, $EX)); 1473 1526 } 1474 1527 else { … … 1511 1564 default: 1512 1565 if ($kk == 'res') { 1566 var_dump($op); 1567 exit; 1513 1568 assert(0); 1514 1569 } … … 1525 1580 function dargs(&$EX, $indent) // {{{ 1526 1581 { 1527 $EX['indent'] = $indent;1528 1582 $op_array = &$EX['op_array']; 1529 1583 … … 1544 1598 echo ', '; 1545 1599 } 1600 $arg = $EX['recvs'][$i + 1]; 1546 1601 if (isset($op_array['arg_info'])) { 1547 1602 $ai = $op_array['arg_info'][$i]; 1548 1603 if (!empty($ai['class_name'])) { 1549 1604 echo $ai['class_name'], ' '; 1550 if ( $ai['allow_null']) {1605 if (!ZEND_ENGINE_2_2 && $ai['allow_null']) { 1551 1606 echo 'or NULL '; 1552 1607 } … … 1554 1609 else if (!empty($ai['array_type_hint'])) { 1555 1610 echo 'array '; 1556 if ( $ai['allow_null']) {1611 if (!ZEND_ENGINE_2_2 && $ai['allow_null']) { 1557 1612 echo 'or NULL '; 1558 1613 } … … 1583 1638 } 1584 1639 } 1585 $arg = $EX['recvs'][$i + 1]; 1586 echo str($arg[0]); 1587 if (isset($arg[1])) { 1588 echo ' = ', str($arg[1]); 1589 } 1640 echo toCode($arg[0], $indent); 1641 } 1642 if (isset($arg[1])) { 1643 echo ' = ', toCode($arg[1], $indent); 1590 1644 } 1591 1645 } … … 1663 1717 echo $newindent; 1664 1718 echo $prefix, $name, ' = '; 1665 echo str(value($v), $EX);1719 echo toCode(value($v), $newindent); 1666 1720 echo ";\n"; 1667 1721 } … … 1670 1724 // }}} 1671 1725 // {{{ properties 1672 if (!empty($class['default_properties']) || !empty($class['default_static_members'])) { 1726 $member_variables = isset($class['properties_info']) ? $class['properties_info'] : ($class['default_static_members'] + $class['default_properties']); 1727 if ($member_variables) { 1673 1728 echo "\n"; 1674 1729 $infos = !empty($class['properties_info']) ? $class['properties_info'] : null; 1675 foreach ( !empty($class['properties_info']) ? $class['properties_info'] : ($class['default_static_members'] + $class['default_properties'])as $name => $dummy) {1730 foreach ($member_variables as $name => $dummy) { 1676 1731 $info = (isset($infos) && isset($infos[$name])) ? $infos[$name] : null; 1677 1732 if (isset($info)) { … … 1699 1754 1700 1755 $mangled = false; 1701 if ( PHP_VERSION < 5) {1756 if (!ZEND_ENGINE_2) { 1702 1757 echo 'var '; 1703 1758 } … … 1726 1781 echo '$', $name; 1727 1782 1728 $key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name; 1729 1730 $value = $class[$static ? 'default_static_members' : 'default_properties'][$key]; 1783 if (isset($info['offset'])) { 1784 $value = $class[$static ? 'default_static_members_table' : 'default_properties_table'][$info['offset']]; 1785 } 1786 else { 1787 $key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name; 1788 1789 $value = $class[$static ? 'default_static_members' : 'default_properties'][$key]; 1790 } 1731 1791 if (isset($value)) { 1732 1792 echo ' = '; 1733 echo str(value($value));1793 echo toCode(value($value), $newindent); 1734 1794 } 1735 1795 echo ";\n"; … … 1856 1916 define('ZEND_ACC_SHADOW', 0x2000); 1857 1917 1858 define('ZEND_FETCH_GLOBAL', 0); 1859 define('ZEND_FETCH_LOCAL', 1); 1860 define('ZEND_FETCH_STATIC', 2); 1861 define('ZEND_FETCH_STATIC_MEMBER', 3); 1862 define('ZEND_FETCH_GLOBAL_LOCK', 4); 1918 define('ZEND_ENGINE_2_4', PHP_VERSION >= "5.3.99"); 1919 define('ZEND_ENGINE_2_3', ZEND_ENGINE_2_4 || PHP_VERSION >= "5.3."); 1920 define('ZEND_ENGINE_2_2', ZEND_ENGINE_2_3 || PHP_VERSION >= "5.2."); 1921 define('ZEND_ENGINE_2_1', ZEND_ENGINE_2_2 || PHP_VERSION >= "5.1."); 1922 define('ZEND_ENGINE_2', ZEND_ENGINE_2_1 || PHP_VERSION >= "5.0."); 1923 1924 if (ZEND_ENGINE_2_4) { 1925 define('ZEND_FETCH_GLOBAL', 0x00000000); 1926 define('ZEND_FETCH_LOCAL', 0x10000000); 1927 define('ZEND_FETCH_STATIC', 0x20000000); 1928 define('ZEND_FETCH_STATIC_MEMBER', 0x30000000); 1929 define('ZEND_FETCH_GLOBAL_LOCK', 0x40000000); 1930 define('ZEND_FETCH_LEXICAL', 0x50000000); 1931 1932 define('ZEND_FETCH_TYPE_MASK', 0x70000000); 1933 } 1934 else { 1935 define('ZEND_FETCH_GLOBAL', 0); 1936 define('ZEND_FETCH_LOCAL', 1); 1937 define('ZEND_FETCH_STATIC', 2); 1938 define('ZEND_FETCH_STATIC_MEMBER', 3); 1939 define('ZEND_FETCH_GLOBAL_LOCK', 4); 1940 } 1863 1941 1864 1942 define('ZEND_FETCH_CLASS_DEFAULT', 0); … … 1870 1948 define('ZEND_FETCH_CLASS_INTERFACE', 6); 1871 1949 define('ZEND_FETCH_CLASS_STATIC', 7); 1950 if (ZEND_ENGINE_2_4) { 1951 define('ZEND_FETCH_CLASS_TRAIT', 14); 1952 } 1953 if (ZEND_ENGINE_2_3) { 1954 define('ZEND_FETCH_CLASS_MASK', 0xF); 1955 } 1872 1956 1873 1957 define('ZEND_EVAL', (1<<0)); … … 1879 1963 define('ZEND_ISSET', (1<<0)); 1880 1964 define('ZEND_ISEMPTY', (1<<1)); 1881 define('EXT_TYPE_UNUSED', (1<<0)); 1965 if (ZEND_ENGINE_2_4) { 1966 define('EXT_TYPE_UNUSED', (1<<5)); 1967 } 1968 else { 1969 define('EXT_TYPE_UNUSED', (1<<0)); 1970 } 1882 1971 1883 1972 define('ZEND_FETCH_STANDARD', 0);
Note: See TracChangeset
for help on using the changeset viewer.

