3v4l.org

run code in 300+ PHP versions simultaneously
<?php function safeEval($arg,$badwords) { if(strpos($arg,$badwords) === true) { echo "it has been found"; return; } else return eval($arg); } $string = "echo 'Hello Kyle';"; $find = "kyle"; safeEval($string,$find);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgve9
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 'echo+%27Hello+Kyle%27%3B'
   13     1        ASSIGN                                                   !1, 'kyle'
   14     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 = 11
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgve9
function name:  safeEval
number of ops:  14
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                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        TYPE_CHECK                                    8          $2
          7      > JMPZ                                                     ~3, ->11
    6     8    >   ECHO                                                     'it+has+been+found'
    7     9      > RETURN                                                   null
         10*       JMP                                                      ->13
   10    11    >   INCLUDE_OR_EVAL                                  $4      !0, EVAL
         12      > RETURN                                                   $4
   11    13*     > RETURN                                                   null

End of function safeeval

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.97 ms | 1397 KiB | 16 Q