Advertisement
fruffl

Unicode Ranger

Apr 23rd, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.61 KB | None | 0 0
  1. try
  2. {
  3.     class lucas extends Application{}
  4.     lucas::getThread();
  5.    
  6.     $string     = new DataTypeString('barbäzföoßĐIJᾕ₱❶❷❸ㅳㅵㅸㅘㄸ㊁㚂㹂䜢');
  7.     $charArray  = $string->toCharArray();
  8.     $range      = new DataTypeArraySegment($charArray, 10, 10);
  9.    
  10.     $iterator   = new Bits(DataTypeStringArray::IT_MODE_LO);
  11.     $reversed   = new DataTypeArray($range, $iterator);
  12.    
  13.     foreach($range as $c) print $c; // prints ĐIJᾕ₱❶❷❸ㅳㅵㅸ
  14.    
  15.     print "\n\n";
  16.  
  17.     foreach($reversed as $c) print $c; // prints ㅸㅵㅳ❸❷❶₱ᾕIJĐ
  18.    
  19.     print "\n\n";
  20.    
  21.     var_dump($reversed);
  22.    
  23. }
  24. catch(\ILLI\Exception\Base $e)
  25. {
  26.     print $e->export()->asText();
  27. }
  28. catch(\Exception $e)
  29. {
  30.     var_dump($e);
  31. }
  32.  
  33.  
  34. /**
  35. ĐIJᾕ₱❶❷❸ㅳㅵㅸ
  36.  
  37. ㅸㅵㅳ❸❷❶₱ᾕIJĐ
  38.  
  39. object(ILLI\System\DataTypeArray)#34 (9) {
  40.   ["__RUNTIME_BITS":"ILLI\System\DataTypeArray":private]=>
  41.   object(ILLI\System\Bits)#33 (1) {
  42.     ["__bits":"ILLI\System\Bits":private]=>
  43.     int(4)
  44.   }
  45.   ["__RECOVERABLE_BITS":"ILLI\System\DataTypeArray":private]=>
  46.   NULL
  47.   ["__offsets":"ILLI\System\DataTypeArray":private]=>
  48.   array(10) {
  49.     [0]=>
  50.     int(10)
  51.     [1]=>
  52.     int(11)
  53.     [2]=>
  54.     int(12)
  55.     [3]=>
  56.     int(13)
  57.     [4]=>
  58.     int(14)
  59.     [5]=>
  60.     int(15)
  61.     [6]=>
  62.     int(16)
  63.     [7]=>
  64.     int(17)
  65.     [8]=>
  66.     int(18)
  67.     [9]=>
  68.     int(19)
  69.   }
  70.   ["__indexes":"ILLI\System\DataTypeArray":private]=>
  71.   array(10) {
  72.     [10]=>
  73.     int(0)
  74.     [11]=>
  75.     int(1)
  76.     [12]=>
  77.     int(2)
  78.     [13]=>
  79.     int(3)
  80.     [14]=>
  81.     int(4)
  82.     [15]=>
  83.     int(5)
  84.     [16]=>
  85.     int(6)
  86.     [17]=>
  87.     int(7)
  88.     [18]=>
  89.     int(8)
  90.     [19]=>
  91.     int(9)
  92.   }
  93.   ["__itIndex":"ILLI\System\DataTypeArray":private]=>
  94.   int(-1)
  95.   ["__lastOffsetInsert":"ILLI\System\DataTypeArray":private]=>
  96.   NULL
  97.   ["__lastOffsetChange":"ILLI\System\DataTypeArray":private]=>
  98.   NULL
  99.   ["__value":protected]=>
  100.   array(10) {
  101.     [10]=>
  102.     object(ILLI\System\DataTypeChar)#15 (8) {
  103.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  104.       bool(true)
  105.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  106.       int(196144)
  107.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  108.       string(5) "2fe30"
  109.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  110.       int(272)
  111.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  112.       string(3) "110"
  113.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  114.       string(6) "U+0110"
  115.       ["__value":protected]=>
  116.       string(2) "Đ"
  117.       ["__initialValue":"ILLI\System\DataType":private]=>
  118.       string(2) "Đ"
  119.     }
  120.     [11]=>
  121.     object(ILLI\System\DataTypeChar)#16 (8) {
  122.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  123.       bool(true)
  124.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  125.       int(196178)
  126.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  127.       string(5) "2fe52"
  128.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  129.       int(306)
  130.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  131.       string(3) "132"
  132.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  133.       string(6) "U+0132"
  134.       ["__value":protected]=>
  135.       string(2) "IJ"
  136.       ["__initialValue":"ILLI\System\DataType":private]=>
  137.       string(2) "IJ"
  138.     }
  139.     [12]=>
  140.     object(ILLI\System\DataTypeChar)#17 (8) {
  141.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  142.       bool(true)
  143.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  144.       int(225190149)
  145.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  146.       string(7) "d6c2105"
  147.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  148.       int(8085)
  149.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  150.       string(4) "1f95"
  151.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  152.       string(6) "U+1f95"
  153.       ["__value":protected]=>
  154.       string(3) "ᾕ"
  155.       ["__initialValue":"ILLI\System\DataType":private]=>
  156.       string(3) "ᾕ"
  157.     }
  158.     [13]=>
  159.     object(ILLI\System\DataTypeChar)#18 (8) {
  160.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  161.       bool(true)
  162.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  163.       int(226130177)
  164.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  165.       string(7) "d7a7901"
  166.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  167.       int(8369)
  168.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  169.       string(4) "20b1"
  170.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  171.       string(6) "U+20b1"
  172.       ["__value":protected]=>
  173.       string(3) "₱"
  174.       ["__initialValue":"ILLI\System\DataType":private]=>
  175.       string(3) "₱"
  176.     }
  177.     [14]=>
  178.     object(ILLI\System\DataTypeChar)#19 (8) {
  179.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  180.       bool(true)
  181.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  182.       int(226157182)
  183.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  184.       string(7) "d7ae27e"
  185.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  186.       int(10102)
  187.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  188.       string(4) "2776"
  189.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  190.       string(6) "U+2776"
  191.       ["__value":protected]=>
  192.       string(3) "❶"
  193.       ["__initialValue":"ILLI\System\DataType":private]=>
  194.       string(3) "❶"
  195.     }
  196.     [15]=>
  197.     object(ILLI\System\DataTypeChar)#20 (8) {
  198.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  199.       bool(true)
  200.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  201.       int(226157183)
  202.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  203.       string(7) "d7ae27f"
  204.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  205.       int(10103)
  206.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  207.       string(4) "2777"
  208.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  209.       string(6) "U+2777"
  210.       ["__value":protected]=>
  211.       string(3) "❷"
  212.       ["__initialValue":"ILLI\System\DataType":private]=>
  213.       string(3) "❷"
  214.     }
  215.     [16]=>
  216.     object(ILLI\System\DataTypeChar)#21 (8) {
  217.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  218.       bool(true)
  219.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  220.       int(226157184)
  221.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  222.       string(7) "d7ae280"
  223.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  224.       int(10104)
  225.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  226.       string(4) "2778"
  227.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  228.       string(6) "U+2778"
  229.       ["__value":protected]=>
  230.       string(3) "❸"
  231.       ["__initialValue":"ILLI\System\DataType":private]=>
  232.       string(3) "❸"
  233.     }
  234.     [17]=>
  235.     object(ILLI\System\DataTypeChar)#22 (8) {
  236.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  237.       bool(true)
  238.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  239.       int(227133179)
  240.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  241.       string(7) "d89c6fb"
  242.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  243.       int(12659)
  244.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  245.       string(4) "3173"
  246.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  247.       string(6) "U+3173"
  248.       ["__value":protected]=>
  249.       string(3) "ㅳ"
  250.       ["__initialValue":"ILLI\System\DataType":private]=>
  251.       string(3) "ㅳ"
  252.     }
  253.     [18]=>
  254.     object(ILLI\System\DataTypeChar)#23 (8) {
  255.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  256.       bool(true)
  257.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  258.       int(227133181)
  259.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  260.       string(7) "d89c6fd"
  261.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  262.       int(12661)
  263.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  264.       string(4) "3175"
  265.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  266.       string(6) "U+3175"
  267.       ["__value":protected]=>
  268.       string(3) "ㅵ"
  269.       ["__initialValue":"ILLI\System\DataType":private]=>
  270.       string(3) "ㅵ"
  271.     }
  272.     [19]=>
  273.     object(ILLI\System\DataTypeChar)#24 (8) {
  274.       ["__isMultibyte":"ILLI\System\DataTypeChar":private]=>
  275.       bool(true)
  276.       ["__dec":"ILLI\System\DataTypeChar":private]=>
  277.       int(227133184)
  278.       ["__dechex":"ILLI\System\DataTypeChar":private]=>
  279.       string(7) "d89c700"
  280.       ["__uni":"ILLI\System\DataTypeChar":private]=>
  281.       int(12664)
  282.       ["__unihex":"ILLI\System\DataTypeChar":private]=>
  283.       string(4) "3178"
  284.       ["__codePoint":"ILLI\System\DataTypeChar":private]=>
  285.       string(6) "U+3178"
  286.       ["__value":protected]=>
  287.       string(3) "ㅸ"
  288.       ["__initialValue":"ILLI\System\DataType":private]=>
  289.       string(3) "ㅸ"
  290.     }
  291.   }
  292.   ["__initialValue":"ILLI\System\DataType":private]=>
  293.     *the init string*
  294. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement