Changeset 1334 in svn
- Timestamp:
- 2013-07-19T05:03:07Z (5 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/devel/run
r1324 r1334 242 242 dc) 243 243 shift 244 ./php-cli -c devel.ini ./bin/phpdc.phpr $@ | tee decompiled.php 244 case "$1" in 245 *.cpp.php) 246 cpp -C -P -traditional-cpp -DPHP_VERSION=$phpVersion $1 \ 247 | sed -r -e 's#^ +##g' -e 's#\t +#\t#g' -e 's#____#__#g' > sample.php || exit $? 248 shift 249 ./php-cli -c devel.ini ./bin/phpdc.phpr sample.php "$@" | tee decompiled.php 250 ;; 251 *) 252 ./php-cli -c devel.ini ./bin/phpdc.phpr "$@" | tee decompiled.php 253 ;; 254 esac 245 255 return 246 256 ;; … … 348 358 349 359 for phpbasename in "${dirs[@]}"; do 360 phpVersion=${phpbasename%%-*} 361 phpVersion=${phpVersion##php} 362 phpVersion=${phpVersion/./} 363 case "$phpVersion" in 364 ??) phpVersion="${phpVersion}0";; 365 ?) phpVersion="${phpVersion}00";; 366 esac 367 350 368 # devel actions 351 369 case "$1" in -
trunk/mod_disassembler/sample.cpp.php
r1331 r1334 1 1 <?php 2 3 /* >= PHP 5.3 2 #if PHP_VERSION >= 500 3 # define ClassClassName ClassName 4 # define PublicMethod public 5 #else 6 # define ClassClassName classname 7 # define PublicMethod 8 # define abstract 9 # define innerIf_ innerif_ 10 # define emptySwitch emptyswitch 11 # define defaultSwitch defaultswitch 12 #endif 13 #if PHP_VERSION >= 520 14 #else 15 # define __callStatic __callstatic 16 # define __toString __tostring 17 #endif 18 #if PHP_VERSION >= 530 19 4 20 namespace ns; 5 // */ 6 7 abstract class Class Name21 #endif 22 23 abstract class ClassClassName 8 24 { 25 #if PHP_VERSION >= 500 9 26 const CONST_VALUE = 'A constant value'; 10 27 … … 31 48 /** doc */ 32 49 protected $protected_property = array(2, 'str'); 33 34 /** doc */ 35 public function __construct($a, $b) 50 #else 51 var $property = array( 52 array('array'), 53 'str' 54 ); 55 #endif 56 57 #if PHP_VERSION >= 500 58 /** doc */ 59 #endif 60 PublicMethod function __construct($a, $b) 36 61 { 37 62 echo CONST_VALUE; 63 #if PHP_VERSION >= 500 38 64 echo ClassName::CONST_VALUE; 39 65 empty(ClassName::$classProp); … … 42 68 ClassName::$classProp = 1; 43 69 echo ClassName::$classProp; 70 #endif 44 71 empty($obj->objProp); 45 72 isset($obj->objProp); 73 #if PHP_VERSION >= 500 46 74 unset($obj->objProp); 75 #endif 47 76 $obj->objProp = 1; 48 77 echo $obj->objProp; 49 78 empty($this->thisProp); 50 79 isset($this->thisProp); 80 #if PHP_VERSION >= 500 51 81 unset($this->thisProp); 82 #endif 52 83 $this->thisProp = 1; 53 84 echo $this->thisProp; 85 #if PHP_VERSION >= 500 54 86 unset($array['index']->valueProp); 87 #endif 55 88 unset($obj->array['index']); 56 89 unset($this->array['index']); … … 72 105 empty($array['index']->indexProp); 73 106 isset($array['index']->indexProp); 107 #if PHP_VERSION >= 500 74 108 unset($array['index']->indexProp); 109 #endif 75 110 $array['index']->indexProp = 1; 76 111 echo $array['index']->indexProp; 77 112 empty($GLOBALS['var']->indexProp); 78 113 isset($GLOBALS['var']->indexProp); 114 #if PHP_VERSION >= 500 79 115 unset($GLOBALS['var']->indexProp); 116 #endif 80 117 $GLOBALS['var']->indexProp = 1; 81 118 echo $GLOBALS['var']->indexProp; 82 } 119 ClassName::__construct(); 120 echo __CLASS__; 121 echo __METHOD__; 122 echo __FUNCTION__; 123 $this->methodCall(); 124 #if PHP_VERSION >= 500 125 throw new Exception(); 126 new Exception(); 127 #endif 128 } 129 #if PHP_VERSION >= 500 83 130 84 131 /** doc */ 85 132 abstract public function abastractMethod(); 86 87 /** doc */ 88 public function method($a = NULL, $b = NULL) 89 { 90 } 91 92 /** doc */ 93 public function publicMethod(ClassName $a = NULL, $b = 2) 94 { 95 } 133 #endif 134 135 #if PHP_VERSION >= 500 136 /** doc */ 137 #endif 138 PublicMethod function method($a = NULL, $b = NULL) 139 { 140 } 141 #if PHP_VERSION >= 500 96 142 97 143 /** doc */ … … 117 163 return 'private'; 118 164 } 119 } 165 #endif 166 } 167 #if PHP_VERSION >= 500 120 168 121 169 interface IInterface … … 123 171 public function nothing(); 124 172 } 173 #endif 125 174 126 175 function f1($f) … … 128 177 echo __FUNCTION__; 129 178 echo $f; 179 #if PHP_VERSION > 550 130 180 131 181 foreach ($a as $b) { … … 134 184 135 185 yield($f); 136 } 186 #endif 187 } 188 #if PHP_VERSION >= 500 137 189 138 190 final class Child extends ClassName implements IInterface … … 141 193 { 142 194 parent::__construct(); 143 ClassName::__construct();144 echo __CLASS__;145 echo __METHOD__;146 echo __FUNCTION__;147 throw new Exception();148 $this->methodCall();149 195 } 150 196 … … 194 240 } 195 241 } 242 #endif 196 243 197 244 if ($late) { 198 245 class LateBindingClass 199 246 { 200 publicfunction __construct()247 PublicMethod function __construct() 201 248 { 202 249 } … … 216 263 $object = new ClassName(); 217 264 $object = new $className(); 265 #if PHP_VERSION >= 500 218 266 $result = $object instanceof ClassName; 219 267 $cloned = clone $object; 268 #endif 220 269 $a = 1; 221 270 $a = $b + $c; … … 284 333 $a = isset($object->prop); 285 334 $a = empty($object->prop); 335 #if PHP_VERSION >= 500 286 336 unset($object->prop); 337 #endif 287 338 $a = isset($this->prop); 288 339 $a = empty($this->prop); 340 #if PHP_VERSION >= 500 289 341 unset($this->prop); 290 342 $a = isset(ClassName::$prop); 291 343 $a = empty(ClassName::$prop); 292 344 unset(ClassName::$prop); 345 #endif 293 346 $a = (int) $b; 294 347 $a = (double) $b; … … 307 360 $a = $b && $c; 308 361 $a = $b || $c; 362 #if PHP_VERSION >= 500 309 363 310 364 do { … … 318 372 echo $e; 319 373 } 374 #if PHP_VERSION >= 550 375 finally { 376 echo 'inner finally'; 377 } 378 #endif 320 379 321 380 echo 'outer try 2'; … … 324 383 echo $e; 325 384 } 385 #if PHP_VERSION >= 550 386 finally { 387 echo 'outer finally'; 388 } 389 #endif 326 390 } while (0); 391 #endif 327 392 328 393 if (if_()) { … … 435 500 } 436 501 437 switch ( emptySwitch()) {502 switch (defaultSwitch()) { 438 503 default: 439 504 } … … 453 518 include 'include.php'; 454 519 include_once 'include_once.php'; 455 echo __FILE__; 456 echo __LINE__; 457 458 /* 520 echo ____FILE____; 521 echo ____LINE____; 522 #if PHP_VERSION >= 530 459 523 echo 'PHP 5.3+ code testing'; 460 524 const CONST_VALUE = 1; … … 514 578 $total += $pricePerItem * $quantity * ($tax + 1); 515 579 }; 516 // */ 580 #endif 517 581 exit(); 518 582
Note: See TracChangeset
for help on using the changeset viewer.