3v4l.org

run code in 500+ PHP versions simultaneously
<?php $totalhousesleft = 1; $iteration = 0; for($x = 8000; $x > 0; $x = $x - 10){ if(empty($iteration)) { $iteration = $x/1000; } if ($totalhousesleft >= $x) { $currentprice = $iteration; $sellingprice = $currentprice + 1; break; } $iteration++; } if(empty($currentprice)){ $currentprice = $iteration; $sellingprice = $currentprice + 1; } var_dump($currentprice, $sellingprice);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
Branch analysis from position: 4
Branch analysis from position: 8
filename:       /in/Mm432
function name:  (null)
number of ops:  29
compiled vars:  !0 = $totalhousesleft, !1 = $iteration, !2 = $x, !3 = $currentprice, !4 = $sellingprice
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 1
    3     1        ASSIGN                                                       !1, 0
    4     2        ASSIGN                                                       !2, 8000
          3      > JMP                                                          ->17
    5     4    >   ISSET_ISEMPTY_CV                                             !1
          5      > JMPZ                                                         ~8, ->8
    6     6    >   DIV                                                  ~9      !2, 1000
          7        ASSIGN                                                       !1, ~9
    8     8    >   IS_SMALLER_OR_EQUAL                                          !2, !0
          9      > JMPZ                                                         ~11, ->14
    9    10    >   ASSIGN                                                       !3, !1
   10    11        ADD                                                  ~13     !3, 1
         12        ASSIGN                                                       !4, ~13
   11    13      > JMP                                                          ->19
   13    14    >   PRE_INC                                                      !1
    4    15        SUB                                                  ~16     !2, 10
         16        ASSIGN                                                       !2, ~16
         17    >   IS_SMALLER                                                   0, !2
         18      > JMPNZ                                                        ~18, ->4
   15    19    >   ISSET_ISEMPTY_CV                                             !3
         20      > JMPZ                                                         ~19, ->24
   16    21    >   ASSIGN                                                       !3, !1
   17    22        ADD                                                  ~21     !3, 1
         23        ASSIGN                                                       !4, ~21
   19    24    >   INIT_FCALL                                                   'var_dump'
         25        SEND_VAR                                                     !3
         26        SEND_VAR                                                     !4
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.53 ms | 1881 KiB | 14 Q