3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dlzka_rurok($miestnost_w, $miestnost_h, $rozostup) { $dlzka = 0; $dlhsie = ($miestnost_w>$miestnost_h? $miestnost_w: $miestnost_h); for($i=1; $i < ($dlhsie/($rozostup*2)); $i++) { $dlzka += $miestnost_w-($i*($rozostup*2)); $dlzka += $miestnost_h-($i*($rozostup*2)); } return ($dlzka*2); } $miestnosti = array( "Izba E" => array(375, 350, 15), "Izba D" => array(375, 362, 15), "Kupelka" => array(183, 248, 10), "Predsien" => array(184, 228, 15), "Kuchyna" => array(200, 350, 15), "Stredna obyvacka" => array(250, 400, 15), "Obyvacka" => array(200, 400, 10) ); $celkova_dlzka = 0; foreach($miestnosti as $key => $value) { $aktualna_dlzka = dlzka_rurok($value[0], $value[1], $value[2]); $celkova_dlzka += $aktualna_dlzka + 600; // pripocitam dlzku k rozdelovacu echo $key.": ".($aktualna_dlzka/100)."m, "; } echo "Celkova dlzka rurok v dome: ".($celkova_dlzka/100)."m (cena PEX-AL-PEX 16x2: ".round((($celkova_dlzka/100)*(0.54*1.2)), 2)." EUR / 20x2: ".round((($celkova_dlzka/100)*(0.85*1.2)), 2)." EUR)";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/psFsE
function name:  (null)
number of ops:  44
compiled vars:  !0 = $miestnosti, !1 = $celkova_dlzka, !2 = $value, !3 = $key, !4 = $aktualna_dlzka
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   28     1        ASSIGN                                                   !1, 0
   29     2      > FE_RESET_R                                       $7      !0, ->22
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->22
          4    >   ASSIGN                                                   !3, ~8
   32     5        INIT_FCALL                                               'dlzka_rurok'
          6        FETCH_DIM_R                                      ~10     !2, 0
          7        SEND_VAL                                                 ~10
          8        FETCH_DIM_R                                      ~11     !2, 1
          9        SEND_VAL                                                 ~11
         10        FETCH_DIM_R                                      ~12     !2, 2
         11        SEND_VAL                                                 ~12
         12        DO_FCALL                                      0  $13     
         13        ASSIGN                                                   !4, $13
   33    14        ADD                                              ~15     !4, 600
         15        ASSIGN_OP                                     1          !1, ~15
   34    16        CONCAT                                           ~17     !3, '%3A+'
         17        DIV                                              ~18     !4, 100
         18        CONCAT                                           ~19     ~17, ~18
         19        CONCAT                                           ~20     ~19, 'm%2C+'
         20        ECHO                                                     ~20
   29    21      > JMP                                                      ->3
         22    >   FE_FREE                                                  $7
   37    23        DIV                                              ~21     !1, 100
         24        CONCAT                                           ~22     'Celkova+dlzka+rurok+v+dome%3A+', ~21
         25        CONCAT                                           ~23     ~22, 'm+%28cena+PEX-AL-PEX+16x2%3A+'
         26        INIT_FCALL                                               'round'
         27        DIV                                              ~24     !1, 100
         28        MUL                                              ~25     ~24, 0.648
         29        SEND_VAL                                                 ~25
         30        SEND_VAL                                                 2
         31        DO_ICALL                                         $26     
         32        CONCAT                                           ~27     ~23, $26
         33        CONCAT                                           ~28     ~27, '+EUR+%2F+20x2%3A+'
         34        INIT_FCALL                                               'round'
         35        DIV                                              ~29     !1, 100
         36        MUL                                              ~30     ~29, 1.02
         37        SEND_VAL                                                 ~30
         38        SEND_VAL                                                 2
         39        DO_ICALL                                         $31     
         40        CONCAT                                           ~32     ~28, $31
         41        CONCAT                                           ~33     ~32, '+EUR%29'
         42        ECHO                                                     ~33
         43      > RETURN                                                   1

Function dlzka_rurok:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 12
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 12
Branch analysis from position: 25
Branch analysis from position: 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
filename:       /in/psFsE
function name:  dlzka_rurok
number of ops:  28
compiled vars:  !0 = $miestnost_w, !1 = $miestnost_h, !2 = $rozostup, !3 = $dlzka, !4 = $dlhsie, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        ASSIGN                                                   !3, 0
    7     4        IS_SMALLER                                               !1, !0
          5      > JMPZ                                                     ~7, ->8
          6    >   QM_ASSIGN                                        ~8      !0
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~8      !1
          9    >   ASSIGN                                                   !4, ~8
    9    10        ASSIGN                                                   !5, 1
         11      > JMP                                                      ->21
   11    12    >   MUL                                              ~11     !2, 2
         13        MUL                                              ~12     !5, ~11
         14        SUB                                              ~13     !0, ~12
         15        ASSIGN_OP                                     1          !3, ~13
   12    16        MUL                                              ~15     !2, 2
         17        MUL                                              ~16     !5, ~15
         18        SUB                                              ~17     !1, ~16
         19        ASSIGN_OP                                     1          !3, ~17
    9    20        PRE_INC                                                  !5
         21    >   MUL                                              ~20     !2, 2
         22        DIV                                              ~21     !4, ~20
         23        IS_SMALLER                                               !5, ~21
         24      > JMPNZ                                                    ~22, ->12
   15    25    >   MUL                                              ~23     !3, 2
         26      > RETURN                                                   ~23
   16    27*     > RETURN                                                   null

End of function dlzka_rurok

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.27 ms | 1403 KiB | 16 Q