3v4l.org

run code in 300+ PHP versions simultaneously
<?php $from = -2; $to = 6; $segments = 20; $f = function($x) { return ($x ^ 2) + (2 * $x) + 3; }; $step = ($to - $from) / $segments; $A = 0; for ($x = $from + ($step / 2); $x < $to; $x += $step) { $A += $f($x) * $step; } echo $A;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 13
Branch analysis from position: 21
Branch analysis from position: 13
filename:       /in/AW1RA
function name:  (null)
number of ops:  23
compiled vars:  !0 = $from, !1 = $to, !2 = $segments, !3 = $f, !4 = $step, !5 = $A, !6 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, -2
    4     1        ASSIGN                                                   !1, 6
    5     2        ASSIGN                                                   !2, 20
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAW1RA%3A6%240'
          4        ASSIGN                                                   !3, ~10
   10     5        SUB                                              ~12     !1, !0
          6        DIV                                              ~13     ~12, !2
          7        ASSIGN                                                   !4, ~13
   11     8        ASSIGN                                                   !5, 0
   14     9        DIV                                              ~16     !4, 2
         10        ADD                                              ~17     !0, ~16
         11        ASSIGN                                                   !6, ~17
         12      > JMP                                                      ->19
   15    13    >   INIT_DYNAMIC_CALL                                        !3
         14        SEND_VAR_EX                                              !6
         15        DO_FCALL                                      0  $19     
         16        MUL                                              ~20     !4, $19
         17        ASSIGN_OP                                     1          !5, ~20
   14    18        ASSIGN_OP                                     1          !6, !4
         19    >   IS_SMALLER                                               !6, !1
         20      > JMPNZ                                                    ~23, ->13
   18    21    >   ECHO                                                     !5
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAW1RA%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AW1RA
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        BW_XOR                                           ~1      !0, 2
          2        MUL                                              ~2      !0, 2
          3        ADD                                              ~3      ~1, ~2
          4        ADD                                              ~4      ~3, 3
          5      > RETURN                                                   ~4
    8     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAW1RA%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.67 ms | 1399 KiB | 13 Q