3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeEval($arg,$badwords) { if(stripos($arg,$badwords) === true) //$arg = explode("''",$arg); //$bardwords = array($badwords); //if(in_array($badwords,$arg)) { str_ireplace($badwords,"''",$arg); //$arg = $arg; eval($arg); //return; } else eval($arg); } $string = "echo 'Hello drop Kyle';"; $find = "drop"; safeEval($string,$find);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6N70O
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'echo+%27Hello+drop+Kyle%27%3B'
   18     1        ASSIGN                                                   !1, 'drop'
   19     2        INIT_FCALL                                               'safeeval'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function safeeval:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6N70O
function name:  safeEval
number of ops:  17
compiled vars:  !0 = $arg, !1 = $badwords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'stripos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        TYPE_CHECK                                    8          $2
          7      > JMPZ                                                     ~3, ->15
    9     8    >   INIT_FCALL                                               'str_ireplace'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 '%27%27'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   11    13        INCLUDE_OR_EVAL                                          !0, EVAL
         14      > JMP                                                      ->16
   15    15    >   INCLUDE_OR_EVAL                                          !0, EVAL
   16    16    > > RETURN                                                   null

End of function safeeval

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.86 ms | 1397 KiB | 18 Q