3v4l.org

run code in 300+ PHP versions simultaneously
<pre><?php $prices = array(149, 199); function price($price) { $price = $price - ($price / 100 * 25); echo "Org: " . $price . "\tRounded: " . (round($price / 5) * 5) . "\n"; } foreach ($prices as $price) { price($price); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/LnNh4
function name:  (null)
number of ops:  10
compiled vars:  !0 = $prices, !1 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Cpre%3E'
    2     1        ASSIGN                                                   !0, <array>
    9     2      > FE_RESET_R                                       $3      !0, ->8
          3    > > FE_FETCH_R                                               $3, !1, ->8
   10     4    >   INIT_FCALL                                               'price'
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0          
    9     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $3
   11     9      > RETURN                                                   1

Function price:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LnNh4
function name:  price
number of ops:  16
compiled vars:  !0 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        DIV                                              ~1      !0, 100
          2        MUL                                              ~2      ~1, 25
          3        SUB                                              ~3      !0, ~2
          4        ASSIGN                                                   !0, ~3
    6     5        CONCAT                                           ~5      'Org%3A+', !0
          6        CONCAT                                           ~6      ~5, '%09Rounded%3A+'
          7        INIT_FCALL                                               'round'
          8        DIV                                              ~7      !0, 5
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        MUL                                              ~9      $8, 5
         12        CONCAT                                           ~10     ~6, ~9
         13        CONCAT                                           ~11     ~10, '%0A'
         14        ECHO                                                     ~11
    7    15      > RETURN                                                   null

End of function price

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.02 ms | 1399 KiB | 16 Q