3v4l.org

run code in 300+ PHP versions simultaneously
<?php $post = array( '$a' => "Ana", '$b' => "George" ); $string = '$a has (2 * 10 + 5) Euro and (10 + 2) cents from $b'; $regex = '#\((([^()]+|(?R))*)\)#'; if (preg_match_all($regex, $string ,$matches)) { $eqs = $matches[1]; foreach($eqs as $frm) { $frm_eval = eval("return $frm;"); $string = str_replace('(' . $frm . ')', $frm_eval, $string); } echo strstr($string, $post); } else { //no parenthesis echo $string; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 34
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/khiME
function name:  (null)
number of ops:  36
compiled vars:  !0 = $post, !1 = $string, !2 = $regex, !3 = $matches, !4 = $eqs, !5 = $frm, !6 = $frm_eval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, '%24a+has+%282+%2A+10+%2B+5%29+Euro+and+%2810+%2B+2%29+cents+from+%24b'
    7     2        ASSIGN                                                   !2, '%23%5C%28%28%28%5B%5E%28%29%5D%2B%7C%28%3FR%29%29%2A%29%5C%29%23'
    8     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !3
          7        DO_ICALL                                         $10     
          8      > JMPZ                                                     $10, ->34
    9     9    >   FETCH_DIM_R                                      ~11     !3, 1
         10        ASSIGN                                                   !4, ~11
   10    11      > FE_RESET_R                                       $13     !4, ->27
         12    > > FE_FETCH_R                                               $13, !5, ->27
   11    13    >   ROPE_INIT                                     3  ~15     'return+'
         14        ROPE_ADD                                      1  ~15     ~15, !5
         15        ROPE_END                                      2  ~14     ~15, '%3B'
         16        INCLUDE_OR_EVAL                                  $17     ~14, EVAL
         17        ASSIGN                                                   !6, $17
   12    18        INIT_FCALL                                               'str_replace'
         19        CONCAT                                           ~19     '%28', !5
         20        CONCAT                                           ~20     ~19, '%29'
         21        SEND_VAL                                                 ~20
         22        SEND_VAR                                                 !6
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $21     
         25        ASSIGN                                                   !1, $21
   10    26      > JMP                                                      ->12
         27    >   FE_FREE                                                  $13
   15    28        INIT_FCALL                                               'strstr'
         29        SEND_VAR                                                 !1
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $23     
         32        ECHO                                                     $23
         33      > JMP                                                      ->35
   19    34    >   ECHO                                                     !1
   20    35    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.33 ms | 1400 KiB | 19 Q