3v4l.org

run code in 300+ PHP versions simultaneously
<?php function y($x) { return pow($x, 2);}function integrate($a, $b, $n) { $h = ($b-$a)/$n; $m = (1/2)*$h; $num = 0; for ($i = 1; $i <= $n-1; $i++) { $num += y($a + $i*$h); } return $m*(y($a) + y($b) + $num);}var_dump(integrate(1, 3, 100));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuaSa
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'integrate'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 3
          4        SEND_VAL                                                 100
          5        DO_FCALL                                      0  $0      
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function y:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuaSa
function name:  y
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'pow'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function y

Function integrate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 11
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 11
Branch analysis from position: 21
Branch analysis from position: 11
filename:       /in/AuaSa
function name:  integrate
number of ops:  32
compiled vars:  !0 = $a, !1 = $b, !2 = $n, !3 = $h, !4 = $m, !5 = $num, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        SUB                                              ~7      !1, !0
          4        DIV                                              ~8      ~7, !2
          5        ASSIGN                                                   !3, ~8
          6        MUL                                              ~10     !3, 0.5
          7        ASSIGN                                                   !4, ~10
          8        ASSIGN                                                   !5, 0
          9        ASSIGN                                                   !6, 1
         10      > JMP                                                      ->18
         11    >   INIT_FCALL                                               'y'
         12        MUL                                              ~14     !6, !3
         13        ADD                                              ~15     !0, ~14
         14        SEND_VAL                                                 ~15
         15        DO_FCALL                                      0  $16     
         16        ASSIGN_OP                                     1          !5, $16
         17        PRE_INC                                                  !6
         18    >   SUB                                              ~19     !2, 1
         19        IS_SMALLER_OR_EQUAL                                      !6, ~19
         20      > JMPNZ                                                    ~20, ->11
         21    >   INIT_FCALL                                               'y'
         22        SEND_VAR                                                 !0
         23        DO_FCALL                                      0  $21     
         24        INIT_FCALL                                               'y'
         25        SEND_VAR                                                 !1
         26        DO_FCALL                                      0  $22     
         27        ADD                                              ~23     $21, $22
         28        ADD                                              ~24     ~23, !5
         29        MUL                                              ~25     !4, ~24
         30      > RETURN                                                   ~25
         31*     > RETURN                                                   null

End of function integrate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.48 ms | 1403 KiB | 21 Q