fork(4) download
  1. <?php
  2.  
  3. error_reporting(-1);
  4.  
  5. function mb_strrev($string) {
  6. return implode('', array_reverse(mb_split('/*/',$string)));
  7. }
  8.  
  9. /* Коды для замены букв */
  10. $code = array(
  11. 'а' => '1',
  12. 'б' => '2',
  13. 'в' => '3',
  14. 'г' => '4',
  15. 'д' => '5',
  16. 'е' => '6',
  17. 'ё' => '7',
  18. 'ж' => '8',
  19. 'з' => '9',
  20. 'и' => '0',
  21. 'й' => '#'
  22. );
  23.  
  24. $text = 'нас предали. явка провалена.';
  25.  
  26.  
  27. $cipher = strtr($text, $code);
  28. $cipher = mb_strrev($cipher);
  29.  
  30. $deCypher = strtr ($cipher, array_flip($code));
  31. $deCypher = mb_strrev($deCypher);
  32.  
  33.  
  34. echo "Оригинал: {$text}\nШифровка: {$cipher}\n";
  35. echo "Шифр дешиврованный: {$deCypher}";
  36.  
  37.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
 ^
Main.java:1: error: class, interface, or enum expected
<?php
  ^
Main.java:5: error: class, interface, or enum expected
function mb_strrev($string) {
^
Main.java:6: error: empty character literal
    return implode('', array_reverse(mb_split('/*/',$string)));
                   ^
Main.java:6: error: unclosed character literal
    return implode('', array_reverse(mb_split('/*/',$string)));
                    ^
Main.java:6: error: unclosed character literal
    return implode('', array_reverse(mb_split('/*/',$string)));
                                              ^
Main.java:6: error: unclosed character literal
    return implode('', array_reverse(mb_split('/*/',$string)));
                                                  ^
Main.java:7: error: class, interface, or enum expected
}
^
Main.java:24: error: class, interface, or enum expected
$text = '??? ???????. ???? ?????????.';
^
Main.java:24: error: unclosed character literal
$text = '??? ???????. ???? ?????????.';
        ^
Main.java:24: error: unclosed character literal
$text = '??? ???????. ???? ?????????.';
                                     ^
Main.java:28: error: class, interface, or enum expected
$cipher = mb_strrev($cipher);
^
Main.java:30: error: class, interface, or enum expected
$deCypher = strtr ($cipher, array_flip($code));
^
Main.java:31: error: class, interface, or enum expected
$deCypher = mb_strrev($deCypher);
^
Main.java:34: error: class, interface, or enum expected
echo "????????: {$text}\n????????: {$cipher}\n";
^
Main.java:35: error: class, interface, or enum expected
echo "???? ?????????????: {$deCypher}";
^
17 errors
stdout
Standard output is empty