 |
|
Quote:ปริศนา buggy งวดที่ 2
มีวิธีแก้ปัญหามากกว่าหนึ่ง
program 1
$people = array(
array(ชื่อ => 'ก', 'รหัส' => 856412),
array('ชื่อ' => 'ข', รหัส => 215863)
);
for($i = 0, ++$i, $size = count($people); $i <= $size++; $i++, print ++$i."<hr>") {
echo "[$i]";
$people[--$i]['รหัส'] = mt_rand(000000, 999999);
echo "{{$i}}";
}
echo "print_r($people)";
buggy
Notice: Use of undefined constant ชื่อ - assumed 'ชื่อ' in /path/to/file.php on line ...
Notice: Use of undefined constant รหัส - assumed 'รหัส' in /path/to/file.php on line ... [1]{0}2
[2]{1}3
[3]{2}4
... (infinite loop) ...
[44916]{44915}44917<
Expected output
[1]{0}2
[2]{1}3
Array
(
[0] => Array
(
[ชื่อ] => ก
[รหัส] => 282515
)
[1] => Array
(
[ชื่อ] => ข
[รหัส] => 277744
)
)
สีแดง คือ เลขสุ่ม
program 2
$N = ((0%1 ? 1:0)+(++$y)-2) == $z**$z ? sqrt(($x=M_PI-1)+($z=$y-.2345)**++$y)+$x : $z ?: 'yes';
echo "Na = ", $N, ",<br>";
echo "x = ".(isset($x) ? $x : 'null'), ", y = ".$y, ", z = ".(!is_null($z) ? $z : 'null');
buggy
Notice: Undefined variable: y in /path/to/file.php on line ...
Notice: Undefined variable: z in /path/to/file.php on line ...
Notice: Undefined variable: z in /path/to/file.php on line ...
Notice: Undefined variable: z in /path/to/file.php on line ... Na = yes,
x = null, y = 1 Notice: Undefined variable: z in /path/to/file.php on line ... , z = null
Required results
Na = 3.793132209153,
x = 2.1415926535898, y = 2, z = 0.7655
program 3
declare(strict_types=1); // the top of file
function greeting(int $lang) {
$word = [];
switch ($lang) {
case "en":
$word[] = "อังกฤษ"; $word[] = "Hello";
break;
case "th":
$word[] = "ไทย"; $word[] = "สวัสดี";
break;
case "ch":
$word[] = "จีน"; $word[] = "你好";
break;
case "jp":
$word[] ="ณี่ปุ่น"; $word[] = "こんにちは";
break;
default:
$word[] = $lang; $word[] = "ยังไม่สนับสนุน";
}
echo "$word[0] : $word[1] <br>";
}
greeting('th');
greeting('ch');
greeting();
greeting('jp');
greeting('kr');
buggy
Fatal error: Uncaught TypeError: Argument 1 passed to greeting() must be of the type integer,
string given, called in /path/to/file.php on line ... and defined in /path/to/file.php:...
Stack trace: #0 /path/to/file.php(...): greeting('th') #1 {main} thrown in
/path/to/file.php on line ...
target
ไทย : สวัสดี
จีน : 你好
อังกฤษ : Hello
ณี่ปุ่น : こんにちは
kr : ยังไม่สนับสนุน
Quote:
bugless encrypted (1)
https://pastebin.com/6gQ0c7Xn
*** ลิงค์ไปข้างนอกแทน เพราะใส่ tag อะไรก็ไม่ยอมตัดข้อความ *** 
bugless decryption การถอดรหัสหวย (PHP cli)
$bugless = "..."; // bugless encrypted (1)
echo `clear`; // Linux
//echo `cls`; // Windows
echo openssl_decrypt (
$bugless,
'AES-128-CTR',
'TGGoD',
0,
'1234567891011121'
);
Tag : PHP
|
ประวัติการแก้ไข 2021-07-01 14:30:18 2021-07-01 14:36:44 2021-07-01 14:39:46 2021-07-01 14:41:28 2021-07-01 14:43:25 2021-07-01 14:53:18
|
 |
 |
 |
 |
Date :
2021-07-01 14:28:01 |
By :
TheGreatGod_of_Death |
View :
660 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |