Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php $found = 0; $limit = 120000; $wanted = 42424; $good = false; $lastfound = ''; ..
Decoded Output download
<?php
$found = 0;
$limit = 120000;
$wanted = 42424;
$good = false;
$lastfound = '';
for ($a = 1; $a < $limit; $a++) {
for ($b = $a; $b < $limit; $b++) {
// Do the squares
$asquared = pow($a, 2);
$bsquared = pow($b, 2);
// Add them up
$sum = $asquared + $bsquared;
// Find the square root
$c = sqrt($sum);
if ($c < $limit && intval($c) == $c) {
// This is a triple
$found++;
$out = $a . $b . $c;
$lastfound = $out;
if ($found == $wanted) {
$good = true;
break 2; // Break both loops
}
}
}
}
if ($good) {
echo $lastfound;
} else {
echo "Desired triple not found";
} ?>
Did this file decode correctly?
Original Code
<?php
$found = 0;
$limit = 120000;
$wanted = 42424;
$good = false;
$lastfound = '';
for ($a = 1; $a < $limit; $a++) {
for ($b = $a; $b < $limit; $b++) {
// Do the squares
$asquared = pow($a, 2);
$bsquared = pow($b, 2);
// Add them up
$sum = $asquared + $bsquared;
// Find the square root
$c = sqrt($sum);
if ($c < $limit && intval($c) == $c) {
// This is a triple
$found++;
$out = $a . $b . $c;
$lastfound = $out;
if ($found == $wanted) {
$good = true;
break 2; // Break both loops
}
}
}
}
if ($good) {
echo $lastfound;
} else {
echo "Desired triple not found";
}
Function Calls
pow | 1 |
Stats
MD5 | 08349804e79d60e98ca0cbac726fb971 |
Eval Count | 0 |
Decode Time | 53 ms |