3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exp = (1+2*3)+4; if(preg_match('~^[0-9()+\-*\/]+$~', $exp)){ eval("echo $exp;"); } else { echo "Bad Expression!"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c4v5i
function name:  (null)
number of ops:  13
compiled vars:  !0 = $exp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 11
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%5E%5B0-9%28%29%2B%5C-%2A%5C%2F%5D%2B%24%7E'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5      > JMPZ                                                     $2, ->11
    5     6    >   ROPE_INIT                                     3  ~4      'echo+'
          7        ROPE_ADD                                      1  ~4      ~4, !0
          8        ROPE_END                                      2  ~3      ~4, '%3B'
          9        INCLUDE_OR_EVAL                                          ~3, EVAL
    4    10      > JMP                                                      ->12
    7    11    >   ECHO                                                     'Bad+Expression%21'
    8    12    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.13 ms | 1009 KiB | 14 Q