3v4l.org

run code in 500+ PHP versions simultaneously
<?php $formula = '(($a+$b)/$c)'; $deviceData["devicename"] = ['a' => 20, 'b' => 30, 'c' => 580]; $runFormula = function ($formula, $data) { extract($data); return eval('return '.$formula.';'); }; echo $runFormula($formula, $deviceData["devicename"]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I2rbk
function name:  (null)
number of ops:  13
compiled vars:  !0 = $formula, !1 = $deviceData, !2 = $runFormula
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%28%28%24a%2B%24b%29%2F%24c%29'
    4     1        ASSIGN_DIM                                                   !1, 'devicename'
          2        OP_DATA                                                      <array>
    6     3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        ASSIGN                                                       !2, ~5
   12     5        INIT_DYNAMIC_CALL                                            !2
          6        SEND_VAR_EX                                                  !0
          7        CHECK_FUNC_ARG                                               
          8        FETCH_DIM_FUNC_ARG                                   $7      !1, 'devicename'
          9        SEND_FUNC_ARG                                                $7
         10        DO_FCALL                                          0  $8      
         11        ECHO                                                         $8
         12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I2rbk
function name:  {closure:/in/I2rbk:6}
number of ops:  10
compiled vars:  !0 = $formula, !1 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2        INIT_FCALL                                                   'extract'
          3        SEND_REF                                                     !1
          4        DO_ICALL                                                     
    8     5        CONCAT                                               ~3      'return+', !0
          6        CONCAT                                               ~4      ~3, '%3B'
          7        INCLUDE_OR_EVAL                                      $5      ~4, EVAL
          8      > RETURN                                                       $5
    9     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.56 ms | 2244 KiB | 14 Q