3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FI2rbk%3A6%240'
          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

Function %00%7Bclosure%7D%2Fin%2FI2rbk%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I2rbk
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FI2rbk%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.19 ms | 1400 KiB | 15 Q