3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = 147.2; $diff = (($price % 10)< 5)? (floor($price / 10) * 10) : (ceil($price / 10) * 10) ; echo $diff;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NZ2CT
function name:  (null)
number of ops:  20
compiled vars:  !0 = $price, !1 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 147.2
    6     1        MOD                                              ~3      !0, 10
          2        IS_SMALLER                                               ~3, 5
          3      > JMPZ                                                     ~4, ->11
          4    >   INIT_FCALL                                               'floor'
          5        DIV                                              ~5      !0, 10
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        MUL                                              ~7      $6, 10
          9        QM_ASSIGN                                        ~8      ~7
         10      > JMP                                                      ->17
         11    >   INIT_FCALL                                               'ceil'
         12        DIV                                              ~9      !0, 10
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                         $10     
         15        MUL                                              ~11     $10, 10
         16        QM_ASSIGN                                        ~8      ~11
         17    >   ASSIGN                                                   !1, ~8
    7    18        ECHO                                                     !1
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.71 ms | 1395 KiB | 17 Q