3v4l.org

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

End of function price

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.48 ms | 1399 KiB | 16 Q