3v4l.org

run code in 300+ PHP versions simultaneously
<?php $theValue = 10000;// the max $bottom = 1; $pi = 0; for ($i = 1; $i<$theValue; $i++){ if ($i % 2 == 1){ $pi += 4 / $bottom; } else { $pi -= 4 / $bottom; } $bottom += 2; } var_dump($pi);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
Branch analysis from position: 5
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 5
Branch analysis from position: 17
Branch analysis from position: 5
filename:       /in/Q8nZr
function name:  (null)
number of ops:  21
compiled vars:  !0 = $theValue, !1 = $bottom, !2 = $pi, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10000
    4     1        ASSIGN                                                   !1, 1
    5     2        ASSIGN                                                   !2, 0
    6     3        ASSIGN                                                   !3, 1
          4      > JMP                                                      ->15
    7     5    >   MOD                                              ~8      !3, 2
          6        IS_EQUAL                                                 ~8, 1
          7      > JMPZ                                                     ~9, ->11
    8     8    >   DIV                                              ~10     4, !1
          9        ASSIGN_OP                                     1          !2, ~10
    7    10      > JMP                                                      ->13
   11    11    >   DIV                                              ~12     4, !1
         12        ASSIGN_OP                                     2          !2, ~12
   13    13    >   ASSIGN_OP                                     1          !1, 2
    6    14        PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, !0
         16      > JMPNZ                                                    ~16, ->5
   15    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.93 ms | 1002 KiB | 14 Q