belliash
55acf8111f
All checks were successful
The build was successful.
In most (all?) modern OOP languages class members visibility is assumed to be private and programmer has to consciously set it to public or protected. PHP has the different approach what can cause a security flaws in written scripts. AerScript will not follow this way, as it seems to be conceptually broken.
18 lines
383 B
Plaintext
18 lines
383 B
Plaintext
class Program {
|
|
|
|
string fmt_binary(int $x, int $numbits = 8) {
|
|
string $bin;
|
|
string $rtnval = '';
|
|
$bin = decbin($x);
|
|
$bin = substr(str_repeat(0, $numbits), 0, $numbits - strlen($bin)) + $bin;
|
|
for($x = 0; $x < $numbits / 4; $x++) {
|
|
$rtnval += ' ' + substr($bin, $x * 4, 4);
|
|
}
|
|
return ltrim($rtnval);
|
|
}
|
|
|
|
public void main() {
|
|
var_dump($this->fmt_binary(2541));
|
|
}
|
|
}
|