3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 2, 5, 7, 11, 12 ]; $x = 5; $y = 10; foreach($tests as $a){ $quo = intval($a / $x); if($quo * $x < $a) $quo++; echo $a," => " ,$quo * $y,PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/rDe3Z
function name:  (null)
number of ops:  20
compiled vars:  !0 = $tests, !1 = $x, !2 = $y, !3 = $a, !4 = $quo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, 5
   12     2        ASSIGN                                                   !2, 10
   14     3      > FE_RESET_R                                       $8      !0, ->18
          4    > > FE_FETCH_R                                               $8, !3, ->18
   15     5    >   DIV                                              ~9      !3, !1
          6        CAST                                          4  ~10     ~9
          7        ASSIGN                                                   !4, ~10
   16     8        MUL                                              ~12     !4, !1
          9        IS_SMALLER                                               ~12, !3
         10      > JMPZ                                                     ~13, ->12
         11    >   PRE_INC                                                  !4
   17    12    >   ECHO                                                     !3
         13        ECHO                                                     '+%3D%3E+'
         14        MUL                                              ~15     !4, !2
         15        ECHO                                                     ~15
         16        ECHO                                                     '%0A'
   14    17      > JMP                                                      ->4
         18    >   FE_FREE                                                  $8
   18    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.63 ms | 1441 KiB | 13 Q