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, 10), "Izba D" => array(375, 362, 10), "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; 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 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/mi8A5
function name:  (null)
number of ops:  43
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, ->21
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->21
          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        ASSIGN_OP                                     1          !1, !4
   34    15        CONCAT                                           ~16     !3, '%3A+'
         16        DIV                                              ~17     !4, 100
         17        CONCAT                                           ~18     ~16, ~17
         18        CONCAT                                           ~19     ~18, 'm%2C+'
         19        ECHO                                                     ~19
   29    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $7
   37    22        DIV                                              ~20     !1, 100
         23        CONCAT                                           ~21     'Celkova+dlzka+rurok+v+dome%3A+', ~20
         24        CONCAT                                           ~22     ~21, 'm+%28cena+PEX-AL-PEX+16x2%3A+'
         25        INIT_FCALL                                               'round'
         26        DIV                                              ~23     !1, 100
         27        MUL                                              ~24     ~23, 0.648
         28        SEND_VAL                                                 ~24
         29        SEND_VAL                                                 2
         30        DO_ICALL                                         $25     
         31        CONCAT                                           ~26     ~22, $25
         32        CONCAT                                           ~27     ~26, '+EUR+%2F+20x2%3A+'
         33        INIT_FCALL                                               'round'
         34        DIV                                              ~28     !1, 100
         35        MUL                                              ~29     ~28, 1.02
         36        SEND_VAL                                                 ~29
         37        SEND_VAL                                                 2
         38        DO_ICALL                                         $30     
         39        CONCAT                                           ~31     ~27, $30
         40        CONCAT                                           ~32     ~31, '+EUR%29'
         41        ECHO                                                     ~32
         42      > 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/mi8A5
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:
149.95 ms | 1403 KiB | 16 Q