3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Huawei E303 | E369 | E357 Free Unlocker * **/ class hw { public function calculate($imei, $mode){ $arrayofbytes = array(); $digesthash = md5($imei.$this->mode($mode)); $arrayofbytes = $this->bytearray($digesthash); return $this->xorbytes($arrayofbytes); } private function mode($arg){ $this->unlock = "5e8dd316726b0335"; $this->flash = "97b7bc6be525ab44"; if($arg == 'unlock'){ return $this->unlock; } else{ return $this->flash; } } private function bytearray($hash){ $splitdigest = substr(chunk_split($hash,2,":"),0,-1); $arrdigest = explode(":",$splitdigest); return $arrdigest; } private function xorbytes($arr){ foreach (range(0,3) as $i) { $code = dechex(hexdec($arr[$i]) ^ hexdec($arr[4+$i]) ^ hexdec($arr[8+$i]) ^ hexdec($arr[12+$i])); if(strlen($code)< 2) { $code = "0" . $code; } $codes = $codes . $code; } $tmpcdec = hexdec($codes); $tmp1dec = hexdec("1ffffff"); $tmp2dec = hexdec("2000000"); $c = $tmpcdec & $tmp1dec; $c = $c | $tmp2dec; return $c; } } echo "<head><title>Huawei Code Calculator</title></head> Huawei E303 | E369 | E357 Code calculator<br><br>"; $imei = htmlspecialchars($_POST['imei']); $hw = new hw(); if(strlen($imei) == 15){ $imei = htmlspecialchars($imei); echo "Results:<br>"; echo "Unlock ". $hw->calculate($imei,"unlock"); echo "<br>"; echo "Flash ".$hw->calculate($imei,"flash"); } else{ if($imei < 15 && $imei > 1) { echo "Error : Invalid IMEI"; } else { echo "Enter imei on box to calculate"; } } echo "<br><br> <form method='post' action=''> IMEI : <input type='text' name='imei' maxlength='15'><br> <input type='submit' value='CALCULATE'> </form>"; echo "<hr>"; echo "Credits to Original algo sharer<br> Script Kiddie PHP<br>"; ?>
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
<head><title>Huawei Code Calculator</title></head> Huawei E303 | E369 | E357 Code calculator<br><br> Warning: Undefined array key "imei" in /in/cOmU1 on line 58 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /in/cOmU1 on line 58 Enter imei on box to calculate<br><br> <form method='post' action=''> IMEI : <input type='text' name='imei' maxlength='15'><br> <input type='submit' value='CALCULATE'> </form><hr>Credits to Original algo sharer<br> Script Kiddie PHP<br>
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.0.0 - 8.0.30
<head><title>Huawei Code Calculator</title></head> Huawei E303 | E369 | E357 Code calculator<br><br> Warning: Undefined array key "imei" in /in/cOmU1 on line 58 Enter imei on box to calculate<br><br> <form method='post' action=''> IMEI : <input type='text' name='imei' maxlength='15'><br> <input type='submit' value='CALCULATE'> </form><hr>Credits to Original algo sharer<br> Script Kiddie PHP<br>
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
<head><title>Huawei Code Calculator</title></head> Huawei E303 | E369 | E357 Code calculator<br><br> Notice: Undefined index: imei in /in/cOmU1 on line 58 Enter imei on box to calculate<br><br> <form method='post' action=''> IMEI : <input type='text' name='imei' maxlength='15'><br> <input type='submit' value='CALCULATE'> </form><hr>Credits to Original algo sharer<br> Script Kiddie PHP<br>
Output for 7.3.32 - 7.3.33
<head><title>Huawei Code Calculator</title></head> Huawei E303 | E369 | E357 Code calculator<br><br>Enter imei on box to calculate<br><br> <form method='post' action=''> IMEI : <input type='text' name='imei' maxlength='15'><br> <input type='submit' value='CALCULATE'> </form><hr>Credits to Original algo sharer<br> Script Kiddie PHP<br>
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
<head><title>Huawei Code Calculator</title></head> Huawei E303 | E369 | E357 Code calculator<br><br> Notice: Undefined index: imei in /in/cOmU1 on line 58 Enter imei on box to calculate<br><br> <form method='post' action=''> IMEI : <input type='text' name='imei' maxlength='15'><br> <input type='submit' value='CALCULATE'> </form><hr>Credits to Original algo sharer<br> Script Kiddie PHP<br>
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/cOmU1 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/cOmU1 on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/cOmU1 on line 9
Process exited with code 255.

preferences:
182.09 ms | 419 KiB | 5 Q