3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeEval($haystack,$needle) { str_ireplace($needle,"' '",$haystack); return eval($haystack); //return; } $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/n4GKu
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'echo+%27Hello+drop+Kyle%27%3B'
   10     1        ASSIGN                                                   !1, 'Drop'
   11     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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n4GKu
function name:  safeEval
number of ops:  10
compiled vars:  !0 = $haystack, !1 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'str_ireplace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%27+%27'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    5     7        INCLUDE_OR_EVAL                                  $3      !0, EVAL
          8      > RETURN                                                   $3
    7     9*     > RETURN                                                   null

End of function safeeval

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.17 ms | 1397 KiB | 16 Q