Changeset 749 for trunk/decompilesample.php
- Timestamp:
- 2011-04-16T21:01:39+02:00 (2 years ago)
- File:
-
- 1 edited
-
trunk/decompilesample.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/decompilesample.php
r748 r749 32 32 { 33 33 echo CONST_VALUE; 34 echo $this::CONST_VALUE;35 echo $a::CONST_VALUE;36 34 echo ClassName::CONST_VALUE; 37 } 38 39 /** doc */ 40 abstract function abastractMethod(); 35 unset(ClassName::$classProp); 36 unset($obj->objProp); 37 unset($this->thisProp); 38 unset($array['index']->valueProp); 39 unset($obj->array['index']); 40 unset($this->array['index']); 41 $obj->objProp = 1; 42 $this->thisProp = 1; 43 $array['index']->valueProp = 1; 44 $array['index'] = 1; 45 $array[1] = 1; 46 } 47 48 /** doc */ 49 abstract public function abastractMethod(); 41 50 42 51 /** doc */ … … 79 88 } 80 89 90 function f1($f) 91 { 92 echo $f; 93 } 94 81 95 final class Child extends ClassName implements IInterface 82 96 { … … 84 98 { 85 99 parent::__construct(); 100 ClassName::__construct(); 86 101 echo __CLASS__; 87 102 echo __METHOD__; 103 throw new Exception(); 104 $this->methodCall(); 105 } 106 107 public function __destruct() 108 { 109 parent::__destruct(); 110 functionCall(); 111 } 112 113 static public function __callStatic($name, $args) 114 { 115 } 116 117 public function __toString() 118 { 88 119 } 89 120 … … 110 141 public function __wakeup() 111 142 { 143 } 144 145 public function __clone() 146 { 147 return array(); 112 148 } 113 149 } … … 115 151 echo str_replace(array('a' => 'a', 'b' => 'c'), 'b'); 116 152 $object = new ClassName(); 153 $object = new $className(); 154 try { 155 echo 'code being try'; 156 } 157 catch (Exception $e) { 158 echo $e; 159 } 117 160 $cloned = clone $object; 118 161 $a = 1; … … 135 178 $a = $b === $c; 136 179 $a = $b != $c; 137 $a = $b <> $c;138 180 $a = $b < $c; 139 181 $a = $b <= $c; 140 $a = $b > $c;141 182 $a = $b <= $c; 142 183 $a = $b++; 143 184 $a = ++$b; 185 $a = $obj->b++; 186 $a = ++$obj->b; 144 187 $a = $b--; 145 188 $a = --$b; 189 $a = $obj->b--; 190 $a = --$obj->b; 146 191 $a = $b and $c; 147 192 $a = $b or $c; … … 150 195 $a = $b && $c; 151 196 $a = $b || $c; 197 $a = $b ? $c : $d; 198 $a = f1() ? f2() : f3(); 152 199 $a = $b instanceof ClassName; 153 200 … … 176 223 177 224 foreach ($array as $key => $value) { 178 echo "$key = $value\n";225 echo $key . ' = ' . $value . "\n"; 179 226 continue; 180 227 } … … 204 251 include_once 'include_once.php'; 205 252 253 //* >= PHP 5.3 254 echo $this::CONST_VALUE; 255 echo $a::CONST_VALUE; 256 $this::__construct(); 257 $obj::__construct(); 258 259 $a = $b ?: $d; 260 $a = f1() ?: f2(); 261 262 echo 'goto a'; 206 263 goto a; 207 echo 'foo'; 264 265 for ($i = 1; $i <= 2; ++$i) { 266 goto a; 267 } 208 268 209 269 a: 210 echo 'bar'; 211 270 echo 'label a'; 212 271 echo preg_replace_callback('~-([a-z])~', function ($match) { 213 return strtoupper($match[1]);272 return strtoupper($match[1]); 214 273 }, 'hello-world'); 215 216 $greet = function($name) 217 { 274 $greet = function ($name) { 218 275 printf("Hello %s\r\n", $name); 219 276 }; 220 277 $greet('World'); 221 278 $greet('PHP'); 222 223 $total = 0.00; 224 225 $callback = function ($quantity, $product) use ($tax, &$total) 226 { 227 $pricePerItem = constant(__CLASS__ . "::PRICE_" . strtoupper($product)); 228 $total += ($pricePerItem * $quantity) * ($tax + 1.0); 279 $total = 0; 280 $callback = function ($quantity, $product) use ($tax, &$total) { 281 $pricePerItem = constant('PRICE_' . strtoupper($product)); 282 $total += $pricePerItem * $quantity * ($tax + 1); 229 283 }; 284 // */ 230 285 231 286 ?>
Note: See TracChangeset
for help on using the changeset viewer.

