3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compute ($stake, $values) { $result = $stake; foreach ($values as $val) { $parts = explode('/', $val); $result *= ($parts[0] / $parts[1] + 1); } return $result; } $stake = 10; $odds = array ( '8/15', '11/2', '13/2', '7/2' ); $result = compute($stake, $odds); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNAGH
function name:  (null)
number of ops:  11
compiled vars:  !0 = $stake, !1 = $odds, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 10
   17     1        ASSIGN                                                   !1, <array>
   23     2        INIT_FCALL                                               'compute'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   24     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function compute:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/RNAGH
function name:  compute
number of ops:  19
compiled vars:  !0 = $stake, !1 = $values, !2 = $result, !3 = $val, !4 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, !0
    6     3      > FE_RESET_R                                       $6      !1, ->16
          4    > > FE_FETCH_R                                               $6, !3, ->16
    8     5    >   INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2F'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !4, $7
    9    10        FETCH_DIM_R                                      ~9      !4, 0
         11        FETCH_DIM_R                                      ~10     !4, 1
         12        DIV                                              ~11     ~9, ~10
         13        ADD                                              ~12     ~11, 1
         14        ASSIGN_OP                                     3          !2, ~12
    6    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $6
   12    17      > RETURN                                                   !2
   13    18*     > RETURN                                                   null

End of function compute

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.04 ms | 1403 KiB | 18 Q