3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // тестовое окружение не перезагружает строковые функции!!! /* ЗАДАЧА 1 * * Дано: * - Текст из *.csv файла * Необходимо: * 1. Распарсить текст, подготовить данные к работе (элемент = тип Объект) * 2. Отсортировать данные по дате затем КБК и вывести в таблице, таким образом, что если существует несколько записей на одну дату с одним КБК, то в поле %% считать среднее, а в скобках вывести кол-во елементов. * * Пример Табл.: * | ДАТА | КБК | Адрес | %% | * | 11.01.2013 | 1-01-001 | Спб, Восстания, 1 | 84% (2) | * */ $data = " 02-01-2013;1-01-001;Спб, Восстания, 1;95 05-01-2013;1-02-011;Спб, Савушкина, 106;87 01-01-2013;1-01-003;Спб, Обводный канал, 12 ;92 06-02-2013;2-05-245;Ростов-на-Дону, Стачек, 41;79 12-01-2012;5-10-002;Новосибирск, Ленина, 105;75 01-01-2013;1-01-003;Спб, Обводный канал, 12 ;98 03-01-2013;6-30-855;Сочи, Коммунистическая, 2;84 05-01-2013;2-04-015;Ростов-на-Дону, Пушкинская, 102;71 07-01-2013;6-01-010;Сочи, Приморская, 26;62 05-01-2013;1-02-011;Спб, Савушкина, 106;89 01-01-2013;1-01-003;Спб, Обводный канал, 12 ;57 "; class Element { public $date; public $kbk; public $addres; public $oth; public $kbkNum; public function __construct($csvtxt) { if ($csvtxt) { $ar=str_getcsv($csvtxt, ';'); if (sizeof($ar)==4) { if ($dt=DateTime::createFromFormat('d-m-Y', $ar[0])) { $this->date=$dt->getTimeStamp(); $this->kbk=trim($ar[1]); $this->kbkNum=intval(str_replace('-', '', $this->kbk)); $this->addres=trim($ar[2]); $this->oth=$ar[3]; } else { throw new \Exception('Некорректная дата.'); } } else { throw new \Exception('Некорректная строка.'); } } } public function getKbkNum() { return $this->kbkNum; } public function getDate() { return $this->date; } public function getKbk() { return $this->kbk; } public function getAddres() { return $this->addres; } public function getOth() { return $this->oth; } public function compare(Element $e) { // сравнение элментов if ($this->getDate()>$e->getDate()) { return 1; } elseif ($this->getDate()<$e->getDate()) { return -1; } else { // даты равны - сравнение кбк if ($this->getKbkNum()==$e->getKbkNum()) return 0;// равны if ($this->getKbkNum()>$e->getKbkNum()) return 1;// больше if ($this->getKbkNum()<$e->getKbkNum()) return -1;// меньше } } // end compare } // end Element class Elements { protected $ar=array(); protected $maxSize=array('addrres'=>5, 'kbk'=>3); public function __construct($text) { $p=0; $size=strlen($text); do { $f=strpos($text, "\n", $p); if ($f!==false) { if ($f>0 && substr($text, $f-1, 1)=="\r") { $line=substr($text, $p, $f-1-$p); } else { $line=substr($text, $p, $f-$p); } $p=$f+1; } elseif ($p<$size) { $line=substr($text, $p); $p=false; } if ($line) { try { $e=new Element($line); $this->maxSize['addres']=max($this->maxSize['addres'], strlen($e->getAddres())); $this->maxSize['kbk']=max($this->maxSize['kbk'], strlen($e->getKbk())); $this->ar[]=$e; } catch (\Exception $e) {} // ошибка формата } } while ($p!==false && $p<$size); } // end public function count() { return sizeof($this->ar); } public function sort() { if (sizeof($this->ar)>0) { usort($this->ar, function ($a, $b) { return $a->compare($b); }); } } // end sort public function __toString() { if (sizeof($this->ar)>0) { $printMask="| %-10s | %-".$this->maxSize['kbk']."s | %-".$this->maxSize['addres']."s | %-8s |\n"; $s=vsprintf($printMask, array('ДАТА', 'КБК', 'АДРЕС', '%%')); $counter=0; $sum=0; $print=false; $prev=false; $count=sizeof($this->ar); for ($i=0; $i<$count; $i++) { $next=( $i+1<$count ? $this->ar[$i+1] : false); $curr=$this->ar[$i]; $counter++; $sum+=$curr->getOth(); if ($next) { if ($curr->getKbkNum()!=$next->getKbkNum() || $curr->getDate()!=$next->getDate()) { $print=true; } } else { // последняя строка данных $print=true; } if ($print) { $forPrint=array( date('d-m-Y', $curr->getDate()), $curr->getKbk(), $curr->getAddres() ); if ($counter>1) { $forPrint[]=round($sum/$counter, 0).'% ('.$counter.')'; } else { $forPrint[]=$sum.'%'; } $s.=vsprintf($printMask, $forPrint); $counter=0; $sum=0; $print=false; } } // end for return $s; } return ''; } // end toString } // end Elements $c=new Elements($data); $c->sort(); echo $c;
based on k1TJj
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data, !1 = $c
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  31     0  E >   ASSIGN                                                   !0, '%0A02-01-2013%3B1-01-001%3B%D0%A1%D0%BF%D0%B1%2C+%D0%92%D0%BE%D1%81%D1%81%D1%82%D0%B0%D0%BD%D0%B8%D1%8F%2C+1%3B95%0A05-01-2013%3B1-02-011%3B%D0%A1%D0%BF%D0%B1%2C+%D0%A1%D0%B0%D0%B2%D1%83%D1%88%D0%BA%D0%B8%D0%BD%D0%B0%2C+106%3B87%0A01-01-2013%3B1-01-003%3B%D0%A1%D0%BF%D0%B1%2C+%D0%9E%D0%B1%D0%B2%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9+%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%2C+12+%3B92%0A06-02-2013%3B2-05-245%3B%D0%A0%D0%BE%D1%81%D1%82%D0%BE%D0%B2-%D0%BD%D0%B0-%D0%94%D0%BE%D0%BD%D1%83%2C+%D0%A1%D1%82%D0%B0%D1%87%D0%B5%D0%BA%2C+41%3B79%0A12-01-2012%3B5-10-002%3B%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D0%B8%D0%B1%D0%B8%D1%80%D1%81%D0%BA%2C+%D0%9B%D0%B5%D0%BD%D0%B8%D0%BD%D0%B0%2C+105%3B75%0A01-01-2013%3B1-01-003%3B%D0%A1%D0%BF%D0%B1%2C+%D0%9E%D0%B1%D0%B2%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9+%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%2C+12+%3B98%0A03-01-2013%3B6-30-855%3B%D0%A1%D0%BE%D1%87%D0%B8%2C+%D0%9A%D0%BE%D0%BC%D0%BC%D1%83%D0%BD%D0%B8%D1%81%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F%2C+2%3B84%0A05-01-2013%3B2-04-015%3B%D0%A0%D0%BE%D1%81%D1%82%D0%BE%D0%B2-%D0%BD%D0%B0-%D0%94%D0%BE%D0%BD%D1%83%2C+%D0%9F%D1%83%D1%88%D0%BA%D0%B8%D0%BD%D1%81%D0%BA%D0%B0%D1%8F%2C+102%3B71%0A07-01-2013%3B6-01-010%3B%D0%A1%D0%BE%D1%87%D0%B8%2C+%D0%9F%D1%80%D0%B8%D0%BC%D0%BE%D1%80%D1%81%D0%BA%D0%B0%D1%8F%2C+26%3B62%0A05-01-2013%3B1-02-011%3B%D0%A1%D0%BF%D0%B1%2C+%D0%A1%D0%B0%D0%B2%D1%83%D1%88%D0%BA%D0%B8%D0%BD%D0%B0%2C+106%3B89%0A01-01-2013%3B1-01-003%3B%D0%A1%D0%BF%D0%B1%2C+%D0%9E%D0%B1%D0%B2%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9+%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%2C+12+%3B57%0A'
  33     1        NOP                                                      
  77     2        NOP                                                      
 169     3        NEW                                              $5      :-5
         4        SEND_VAR_EX                                              !0
         5        DO_FCALL                                      0          
         6        ASSIGN                                                   !1, $5
 170     7        INIT_METHOD_CALL                                         !1, 'sort'
         8        DO_FCALL                                      0          
 171     9        ECHO                                                     !1
        10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FrbLoP0x7fbfebce8fa2:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 115     0  E >   RECV                                             !0      
         1        RECV                                             !1      
 116     2        INIT_METHOD_CALL                                         !0, 'compare'
         3        SEND_VAR_EX                                              !1
         4        DO_FCALL                                      0  $2      
         5      > RETURN                                                   $2
 117     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FrbLoP0x7fbfebce8fa2

Class Element:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 2, Position 2 = 59
Branch analysis from position: 2
Jump found. Position 1 = 12, Position 2 = 55
Branch analysis from position: 12
Jump found. Position 1 = 19, Position 2 = 50
Branch analysis from position: 19
Jump found. Position 1 = 54
Branch analysis from position: 54
Jump found. Position 1 = 59
Branch analysis from position: 59
Jump found. Position 1 = -2
Branch analysis from position: 50
Jump found. Position 1 = -2
Branch analysis from position: 55
Jump found. Position 1 = -2
Branch analysis from position: 59
filename:       /in/rbLoP
function name:  __construct
number of ops:  60
compiled vars:  !0 = $csvtxt, !1 = $ar, !2 = $dt
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  40     0  E >   RECV                                             !0      
  41     1      > JMPZ                                                     !0, ->59
  42     2    >   INIT_FCALL                                               'str_getcsv'
         3        SEND_VAR                                                 !0
         4        SEND_VAL                                                 '%3B'
         5        DO_ICALL                                         $3      
         6        ASSIGN                                                   !1, $3
  43     7        INIT_FCALL                                               'sizeof'
         8        SEND_VAR                                                 !1
         9        DO_ICALL                                         $5      
        10        IS_EQUAL                                         ~6      $5, 4
        11      > JMPZ                                                     ~6, ->55
  44    12    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
        13        SEND_VAL_EX                                              'd-m-Y'
        14        FETCH_DIM_FUNC_ARG                               $7      !1, 0
        15        SEND_VAR_EX                                              $7
        16        DO_FCALL                                      0  $8      
        17        ASSIGN                                           $9      !2, $8
        18      > JMPZ                                                     $9, ->50
  45    19    >   INIT_METHOD_CALL                                         !2, 'getTimeStamp'
        20        DO_FCALL                                      0  $11     
        21        ASSIGN_OBJ                                               'date'
        22        OP_DATA                                                  $11
  46    23        INIT_FCALL                                               'trim'
        24        FETCH_DIM_R                                      $13     !1, 1
        25        SEND_VAR                                                 $13
        26        DO_ICALL                                         $14     
        27        ASSIGN_OBJ                                               'kbk'
        28        OP_DATA                                                  $14
  47    29        INIT_FCALL                                               'intval'
        30        INIT_FCALL                                               'str_replace'
        31        SEND_VAL                                                 '-'
        32        SEND_VAL                                                 ''
        33        FETCH_OBJ_R                                      $16     'kbk'
        34        SEND_VAR                                                 $16
        35        DO_ICALL                                         $17     
        36        SEND_VAR                                                 $17
        37        DO_ICALL                                         $18     
        38        ASSIGN_OBJ                                               'kbkNum'
        39        OP_DATA                                                  $18
  48    40        INIT_FCALL                                               'trim'
        41        FETCH_DIM_R                                      $20     !1, 2
        42        SEND_VAR                                                 $20
        43        DO_ICALL                                         $21     
        44        ASSIGN_OBJ                                               'addres'
        45        OP_DATA                                                  $21
  49    46        FETCH_DIM_R                                      $23     !1, 3
        47        ASSIGN_OBJ                                               'oth'
        48        OP_DATA                                                  $23
        49      > JMP                                                      ->54
  51    50    >   NEW                                              $24     :21
        51        SEND_VAL_EX                                              '%D0%9D%D0%B5%D0%BA%D0%BE%D1%80%D1%80%D0%B5%D0%BA%D1%82%D0%BD%D0%B0%D1%8F+%D0%B4%D0%B0%D1%82%D0%B0.'
        52        DO_FCALL                                      0          
        53      > THROW                                         0          $24
        54    > > JMP                                                      ->59
  54    55    >   NEW                                              $26     :24
        56        SEND_VAL_EX                                              '%D0%9D%D0%B5%D0%BA%D0%BE%D1%80%D1%80%D0%B5%D0%BA%D1%82%D0%BD%D0%B0%D1%8F+%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B0.'
        57        DO_FCALL                                      0          
        58      > THROW                                         0          $26
  57    59    > > RETURN                                                   null

End of function __construct

Function getkbknum:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  getKbkNum
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  59     0  E >   FETCH_OBJ_R                                      $0      'kbkNum'
         1      > RETURN                                                   $0
         2*     > RETURN                                                   null

End of function getkbknum

Function getdate:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  getDate
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  60     0  E >   FETCH_OBJ_R                                      $0      'date'
         1      > RETURN                                                   $0
         2*     > RETURN                                                   null

End of function getdate

Function getkbk:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  getKbk
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  61     0  E >   FETCH_OBJ_R                                      $0      'kbk'
         1      > RETURN                                                   $0
         2*     > RETURN                                                   null

End of function getkbk

Function getaddres:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  getAddres
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  62     0  E >   FETCH_OBJ_R                                      $0      'addres'
         1      > RETURN                                                   $0
         2*     > RETURN                                                   null

End of function getaddres

Function getoth:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  getOth
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  63     0  E >   FETCH_OBJ_R                                      $0      'oth'
         1      > RETURN                                                   $0
         2*     > RETURN                                                   null

End of function getoth

Function compare:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
Jump found. Position 1 = -2
Branch analysis from position: 9
Jump found. Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
Jump found. Position 1 = -2
Branch analysis from position: 17
Jump found. Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
Jump found. Position 1 = -2
Branch analysis from position: 24
Jump found. Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
Jump found. Position 1 = -2
Branch analysis from position: 31
Jump found. Position 1 = 37, Position 2 = 38
Branch analysis from position: 37
Jump found. Position 1 = -2
Branch analysis from position: 38
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  compare
number of ops:  39
compiled vars:  !0 = $e
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  64     0  E >   RECV                                             !0      
  65     1        INIT_METHOD_CALL                                         'getDate'
         2        DO_FCALL                                      0  $1      
         3        INIT_METHOD_CALL                                         !0, 'getDate'
         4        DO_FCALL                                      0  $2      
         5        IS_SMALLER                                       ~3      $2, $1
         6      > JMPZ                                                     ~3, ->9
  66     7    > > RETURN                                                   1
         8*       JMP                                                      ->38
  67     9    >   INIT_METHOD_CALL                                         'getDate'
        10        DO_FCALL                                      0  $4      
        11        INIT_METHOD_CALL                                         !0, 'getDate'
        12        DO_FCALL                                      0  $5      
        13        IS_SMALLER                                       ~6      $4, $5
        14      > JMPZ                                                     ~6, ->17
  68    15    > > RETURN                                                   -1
        16*       JMP                                                      ->38
  70    17    >   INIT_METHOD_CALL                                         'getKbkNum'
        18        DO_FCALL                                      0  $7      
        19        INIT_METHOD_CALL                                         !0, 'getKbkNum'
        20        DO_FCALL                                      0  $8      
        21        IS_EQUAL                                         ~9      $7, $8
        22      > JMPZ                                                     ~9, ->24
        23    > > RETURN                                                   0
  71    24    >   INIT_METHOD_CALL                                         'getKbkNum'
        25        DO_FCALL                                      0  $10     
        26        INIT_METHOD_CALL                                         !0, 'getKbkNum'
        27        DO_FCALL                                      0  $11     
        28        IS_SMALLER                                       ~12     $11, $10
        29      > JMPZ                                                     ~12, ->31
        30    > > RETURN                                                   1
  72    31    >   INIT_METHOD_CALL                                         'getKbkNum'
        32        DO_FCALL                                      0  $13     
        33        INIT_METHOD_CALL                                         !0, 'getKbkNum'
        34        DO_FCALL                                      0  $14     
        35        IS_SMALLER                                       ~15     $13, $14
        36      > JMPZ                                                     ~15, ->38
        37    > > RETURN                                                   -1
  74    38    > > RETURN                                                   null

End of function compare

End of class Element.

Class Elements:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 12, Position 2 = 42
Branch analysis from position: 12
Jump found. Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
Jump found. Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
Jump found. Position 1 = 39
Branch analysis from position: 39
Jump found. Position 1 = 50
Branch analysis from position: 50
Jump found. Position 1 = 51, Position 2 = 84
Branch analysis from position: 51
Jump found. Position 1 = 84
Branch analysis from position: 84
Jump found. Position 1 = 86, Position 2 = 88
Branch analysis from position: 86
Jump found. Position 1 = 89, Position 2 = 4
Branch analysis from position: 89
Jump found. Position 1 = -2
Branch analysis from position: 4
Branch analysis from position: 88
Branch analysis from position: 84
Branch analysis from position: 32
Jump found. Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 22
Branch analysis from position: 42
Jump found. Position 1 = 44, Position 2 = 50
Branch analysis from position: 44
Jump found. Position 1 = 51, Position 2 = 84
Branch analysis from position: 51
Branch analysis from position: 84
Branch analysis from position: 50
Found catch point at position: 83
Branch analysis from position: 83
Jump found. Position 1 = 84, Position 2 = -2
Branch analysis from position: 84
filename:       /in/rbLoP
function name:  __construct
number of ops:  90
compiled vars:  !0 = $text, !1 = $p, !2 = $size, !3 = $f, !4 = $line, !5 = $e
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  82     0  E >   RECV                                             !0      
  83     1        ASSIGN                                                   !1, 0
  84     2        STRLEN                                           ~7      !0
         3        ASSIGN                                                   !2, ~7
  86     4    >   INIT_FCALL                                               'strpos'
         5        SEND_VAR                                                 !0
         6        SEND_VAL                                                 '%0A'
         7        SEND_VAR                                                 !1
         8        DO_ICALL                                         $9      
         9        ASSIGN                                                   !3, $9
  87    10        IS_NOT_IDENTICAL                                 ~11     !3, <false>
        11      > JMPZ                                                     ~11, ->42
  88    12    >   IS_SMALLER                                       ~12     0, !3
        13      > JMPZ_EX                                          ~12     ~12, ->22
        14    >   INIT_FCALL                                               'substr'
        15        SEND_VAR                                                 !0
        16        SUB                                              ~13     !3, 1
        17        SEND_VAL                                                 ~13
        18        SEND_VAL                                                 1
        19        DO_ICALL                                         $14     
        20        IS_EQUAL                                         ~15     $14, '%0D'
        21        BOOL                                             ~12     ~15
        22    > > JMPZ                                                     ~12, ->32
  89    23    >   INIT_FCALL                                               'substr'
        24        SEND_VAR                                                 !0
        25        SEND_VAR                                                 !1
        26        SUB                                              ~16     !3, 1
        27        SUB                                              ~17     ~16, !1
        28        SEND_VAL                                                 ~17
        29        DO_ICALL                                         $18     
        30        ASSIGN                                                   !4, $18
        31      > JMP                                                      ->39
  91    32    >   INIT_FCALL                                               'substr'
        33        SEND_VAR                                                 !0
        34        SEND_VAR                                                 !1
        35        SUB                                              ~20     !3, !1
        36        SEND_VAL                                                 ~20
        37        DO_ICALL                                         $21     
        38        ASSIGN                                                   !4, $21
  93    39    >   ADD                                              ~23     !3, 1
        40        ASSIGN                                                   !1, ~23
        41      > JMP                                                      ->50
  94    42    >   IS_SMALLER                                       ~25     !1, !2
        43      > JMPZ                                                     ~25, ->50
  95    44    >   INIT_FCALL                                               'substr'
        45        SEND_VAR                                                 !0
        46        SEND_VAR                                                 !1
        47        DO_ICALL                                         $26     
        48        ASSIGN                                                   !4, $26
  96    49        ASSIGN                                                   !1, <false>
  98    50    > > JMPZ                                                     !4, ->84
 100    51    >   NEW                                              $29     :9
        52        SEND_VAR_EX                                              !4
        53        DO_FCALL                                      0          
        54        ASSIGN                                                   !5, $29
 101    55        INIT_FCALL                                               'max'
        56        FETCH_OBJ_R                                      $34     'maxSize'
        57        FETCH_DIM_R                                      $35     $34, 'addres'
        58        SEND_VAR                                                 $35
        59        INIT_METHOD_CALL                                         !5, 'getAddres'
        60        DO_FCALL                                      0  $36     
        61        STRLEN                                           ~37     $36
        62        SEND_VAL                                                 ~37
        63        DO_ICALL                                         $38     
        64        FETCH_OBJ_W                                      $32     'maxSize'
        65        ASSIGN_DIM                                               $32, 'addres'
        66        OP_DATA                                                  $38
 102    67        INIT_FCALL                                               'max'
        68        FETCH_OBJ_R                                      $41     'maxSize'
        69        FETCH_DIM_R                                      $42     $41, 'kbk'
        70        SEND_VAR                                                 $42
        71        INIT_METHOD_CALL                                         !5, 'getKbk'
        72        DO_FCALL                                      0  $43     
        73        STRLEN                                           ~44     $43
        74        SEND_VAL                                                 ~44
        75        DO_ICALL                                         $45     
        76        FETCH_OBJ_W                                      $39     'maxSize'
        77        ASSIGN_DIM                                               $39, 'kbk'
        78        OP_DATA                                                  $45
 103    79        FETCH_OBJ_W                                      $46     'ar'
        80        ASSIGN_DIM                                               $46
        81        OP_DATA                                                  !5
        82      > JMP                                                      ->84
 104    83  E > > CATCH                                                    'Exception', !5
 106    84    >   IS_NOT_IDENTICAL                                 ~48     !1, <false>
        85      > JMPZ_EX                                          ~48     ~48, ->88
        86    >   IS_SMALLER                                       ~49     !1, !2
        87        BOOL                                             ~48     ~49
        88    > > JMPNZ                                                    ~48, ->4
 107    89    > > RETURN                                                   null

End of function __construct

Function count:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  count
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 110     0  E >   INIT_FCALL                                               'sizeof'
         1        FETCH_OBJ_R                                      $0      'ar'
         2        SEND_VAR                                                 $0
         3        DO_ICALL                                         $1      
         4      > RETURN                                                   $1
 111     5*     > RETURN                                                   null

End of function count

Function sort:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
Jump found. Position 1 = -2
Branch analysis from position: 12
filename:       /in/rbLoP
function name:  sort
number of ops:  13
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 114     0  E >   INIT_FCALL                                               'sizeof'
         1        FETCH_OBJ_R                                      $0      'ar'
         2        SEND_VAR                                                 $0
         3        DO_ICALL                                         $1      
         4        IS_SMALLER                                       ~2      0, $1
         5      > JMPZ                                                     ~2, ->12
 115     6    >   INIT_FCALL                                               'usort'
         7        FETCH_OBJ_W                                      $3      'ar'
         8        SEND_REF                                                 $3
         9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrbLoP0x7fbfebce8fa2'
 117    10        SEND_VAL                                                 ~4
        11        DO_ICALL                                                 
 119    12    > > RETURN                                                   null

End of function sort

Function __tostring:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 6, Position 2 = 110
Branch analysis from position: 6
Jump found. Position 1 = 107
Branch analysis from position: 107
Jump found. Position 1 = 109, Position 2 = 31
Branch analysis from position: 109
Jump found. Position 1 = -2
Branch analysis from position: 31
Jump found. Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
Jump found. Position 1 = 40
Branch analysis from position: 40
Jump found. Position 1 = 50, Position 2 = 65
Branch analysis from position: 50
Jump found. Position 1 = 56, Position 2 = 62
Branch analysis from position: 56
Jump found. Position 1 = 63, Position 2 = 64
Branch analysis from position: 63
Jump found. Position 1 = 66
Branch analysis from position: 66
Jump found. Position 1 = 67, Position 2 = 105
Branch analysis from position: 67
Jump found. Position 1 = 83, Position 2 = 94
Branch analysis from position: 83
Jump found. Position 1 = 97
Branch analysis from position: 97
Jump found. Position 1 = 109, Position 2 = 31
Branch analysis from position: 109
Branch analysis from position: 31
Branch analysis from position: 94
Jump found. Position 1 = 109, Position 2 = 31
Branch analysis from position: 109
Branch analysis from position: 31
Branch analysis from position: 105
Branch analysis from position: 64
Branch analysis from position: 62
Branch analysis from position: 65
Jump found. Position 1 = 67, Position 2 = 105
Branch analysis from position: 67
Branch analysis from position: 105
Branch analysis from position: 39
Jump found. Position 1 = 50, Position 2 = 65
Branch analysis from position: 50
Branch analysis from position: 65
Branch analysis from position: 110
Jump found. Position 1 = -2
filename:       /in/rbLoP
function name:  __toString
number of ops:  112
compiled vars:  !0 = $printMask, !1 = $s, !2 = $counter, !3 = $sum, !4 = $print, !5 = $prev, !6 = $count, !7 = $i, !8 = $next, !9 = $curr, !10 = $forPrint
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 122     0  E >   INIT_FCALL                                               'sizeof'
         1        FETCH_OBJ_R                                      $11     'ar'
         2        SEND_VAR                                                 $11
         3        DO_ICALL                                         $12     
         4        IS_SMALLER                                       ~13     0, $12
         5      > JMPZ                                                     ~13, ->110
 123     6    >   FETCH_OBJ_R                                      $14     'maxSize'
         7        FETCH_DIM_R                                      $15     $14, 'kbk'
         8        CONCAT                                           ~16     '%7C+%25-10s+%7C+%25-', $15
         9        CONCAT                                           ~17     ~16, 's+%7C+%25-'
        10        FETCH_OBJ_R                                      $18     'maxSize'
        11        FETCH_DIM_R                                      $19     $18, 'addres'
        12        CONCAT                                           ~20     ~17, $19
        13        CONCAT                                           ~21     ~20, 's+%7C+%25-8s+%7C%0A'
        14        ASSIGN                                                   !0, ~21
 124    15        INIT_FCALL                                               'vsprintf'
        16        SEND_VAR                                                 !0
        17        SEND_VAL                                                 <array>
        18        DO_ICALL                                         $23     
        19        ASSIGN                                                   !1, $23
 126    20        ASSIGN                                                   !2, 0
 127    21        ASSIGN                                                   !3, 0
 128    22        ASSIGN                                                   !4, <false>
 129    23        ASSIGN         

Generated using Vulcan Logic Dumper, using php 7.1.0