3v4l.org

run code in 300+ PHP versions simultaneously
<?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;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rbLoP
function name:  (null)
number of ops:  10
compiled vars:  !0 = $data, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     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'
   77     1        DECLARE_CLASS                                            'elements'
  169     2        NEW                                              $3      'Elements'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $3
  170     6        INIT_METHOD_CALL                                         !1, 'sort'
          7        DO_FCALL                                      0          
  171     8        ECHO                                                     !1
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FrbLoP%3A115%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) 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%2FrbLoP%3A115%240

Class Element:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 55
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 51
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 46
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 55
filename:       /in/rbLoP
function name:  __construct
number of ops:  56
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, ->55
   42     2    >   INIT_FCALL                                               'str_getcsv'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%3B'
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
   43     7        COUNT                                            ~5      !1
          8        IS_EQUAL                                                 ~5, 4
          9      > JMPZ                                                     ~6, ->51
   44    10    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         11        SEND_VAL                                                 'd-m-Y'
         12        FETCH_DIM_R                                      ~7      !1, 0
         13        SEND_VAL                                                 ~7
         14        DO_FCALL                                      0  $8      
         15        ASSIGN                                           ~9      !2, $8
         16      > JMPZ                                                     ~9, ->46
   45    17    >   INIT_METHOD_CALL                                         !2, 'getTimeStamp'
         18        DO_FCALL                                      0  $11     
         19        ASSIGN_OBJ                                               'date'
         20        OP_DATA                                                  $11
   46    21        INIT_FCALL                                               'trim'
         22        FETCH_DIM_R                                      ~13     !1, 1
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                         $14     
         25        ASSIGN_OBJ                                               'kbk'
         26        OP_DATA                                                  $14
   47    27        INIT_FCALL                                               'str_replace'
         28        SEND_VAL                                                 '-'
         29        SEND_VAL                                                 ''
         30        FETCH_OBJ_R                                      ~16     'kbk'
         31        SEND_VAL                                                 ~16
         32        DO_ICALL                                         $17     
         33        CAST                                          4  ~18     $17
         34        ASSIGN_OBJ                                               'kbkNum'
         35        OP_DATA                                                  ~18
   48    36        INIT_FCALL                                               'trim'
         37        FETCH_DIM_R                                      ~20     !1, 2
         38        SEND_VAL                                                 ~20
         39        DO_ICALL                                         $21     
         40        ASSIGN_OBJ                                               'addres'
         41        OP_DATA                                                  $21
   49    42        FETCH_DIM_R                                      ~23     !1, 3
         43        ASSIGN_OBJ                                               'oth'
         44        OP_DATA                                                  ~23
         45      > JMP                                                      ->50
   51    46    >   NEW                                              $24     'Exception'
         47        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.'
         48        DO_FCALL                                      0          
         49      > THROW                                         0          $24
         50    > > JMP                                                      ->55
   54    51    >   NEW                                              $26     'Exception'
         52        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.'
         53        DO_FCALL                                      0          
         54      > THROW                                         0          $26
   57    55    > > RETURN                                                   null

End of function __construct

Function getkbknum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) 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
1 jumps found. (Code = 62) 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
1 jumps found. (Code = 62) 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
1 jumps found. (Code = 62) 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
1 jumps found. (Code = 62) 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
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 38
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) 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                                               $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                                               $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                                                 $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                                               $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                                               $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
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 42
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 84
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
2 jumps found. (Code = 46) Position 1 = 86, Position 2 = 88
Branch analysis from position: 86
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 4
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
Branch analysis from position: 88
Branch analysis from position: 84
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 22
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 50
Branch analysis from position: 44
2 jumps found. (Code = 43) 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
2 jumps found. (Code = 107) 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        TYPE_CHECK                                  1018          !3
         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                                               !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     'Element'
         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_VAL                                                 ~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_VAL                                                 ~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                                       last         'Exception'
  106    84    >   TYPE_CHECK                                  1018  ~48     !1
         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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rbLoP
function name:  count
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  110     0  E >   FETCH_OBJ_R                                      ~0      'ar'
          1        COUNT                                            ~1      ~0
          2      > RETURN                                                   ~1
  111     3*     > RETURN                                                   null

End of function count

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

End of function sort

Function __tostring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 105
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 101
Branch analysis from position: 101
2 jumps found. (Code = 44) Position 1 = 103, Position 2 = 27
Branch analysis from position: 103
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 60
Branch analysis from position: 45
2 jumps found. (Code = 47) Position 1 = 51, Position 2 = 57
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 59
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 100
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 89
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 92
Branch analysis from position: 92
2 jumps found. (Code = 44) Position 1 = 103, Position 2 = 27
Branch analysis from position: 103
Branch analysis from position: 27
Branch analysis from position: 89
2 jumps found. (Code = 44) Position 1 = 103, Position 2 = 27
Branch analysis from position: 103
Branch analysis from position: 27
Branch analysis from position: 100
Branch analysis from position: 59
Branch analysis from position: 57
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 100
Branch analysis from position: 62
Branch analysis from position: 100
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 60
Branch analysis from position: 45
Branch analysis from position: 60
Branch analysis from position: 105
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rbLoP
function name:  __toString
number of ops:  108
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 >   FETCH_OBJ_R                                      ~11     'ar'
          1        COUNT                                            ~12     ~11
          2        IS_SMALLER                                               0, ~12
          3      > JMPZ                                                     ~13, ->105
  123     4    >   FETCH_OBJ_R                                      ~14     'maxSize'
          5        FETCH_DIM_R                                      ~15     ~14, 'kbk'
          6        CONCAT                                           ~16     '%7C+%25-10s+%7C+%25-', ~15
          7        CONCAT                                           ~17     ~16, 's+%7C+%25-'
          8        FETCH_OBJ_R                                      ~18     'maxSize'
          9        FETCH_DIM_R                                      ~19     ~18, 'addres'
         10        CONCAT                                           ~20     ~17, ~19
         11        CONCAT                                           ~21     ~20, 's+%7C+%25-8s+%7C%0A'
         12        ASSIGN                                                   !0, ~21
  124    13        INIT_FCALL                                               'vsprintf'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 <array>
         16        DO_ICALL                                         $23     
         17        ASSIGN                            

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.08 ms | 1432 KiB | 30 Q