3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sphinxesc($x){ $depth = 0; for ($i = 0; $i < strlen($x); ++$i){ $depth += $x[$i] == '(' ? 1 : 0; $depth -= $x[$i] == ')' ? 1 : 0; } if($depth != 0) $x = str_replace(array('(',')'),' ',$x); $x = str_replace(array('/','~','@'), ' ',$x); $x = preg_replace('/[\!\-\^]+(?!\w)/', ' ',$x); } echo sphinxesc('hi! this is shit!');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RJA5t
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'sphinxesc'
          1        SEND_VAL                                                 'hi%21+this+is+shit%21'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function sphinxesc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 4
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 4
Branch analysis from position: 22
Branch analysis from position: 4
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 4
Branch analysis from position: 22
Branch analysis from position: 4
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
Branch analysis from position: 16
filename:       /in/RJA5t
function name:  sphinxesc
number of ops:  43
compiled vars:  !0 = $x, !1 = $depth, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 0
    4     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->19
    5     4    >   FETCH_DIM_R                                      ~5      !0, !2
          5        IS_EQUAL                                                 ~5, '%28'
          6      > JMPZ                                                     ~6, ->9
          7    >   QM_ASSIGN                                        ~7      1
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~7      0
         10    >   ASSIGN_OP                                     1          !1, ~7
    6    11        FETCH_DIM_R                                      ~9      !0, !2
         12        IS_EQUAL                                                 ~9, '%29'
         13      > JMPZ                                                     ~10, ->16
         14    >   QM_ASSIGN                                        ~11     1
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~11     0
         17    >   ASSIGN_OP                                     2          !1, ~11
    4    18        PRE_INC                                                  !2
         19    >   STRLEN                                           ~14     !0
         20        IS_SMALLER                                               !2, ~14
         21      > JMPNZ                                                    ~15, ->4
    9    22    >   IS_NOT_EQUAL                                             !1, 0
         23      > JMPZ                                                     ~16, ->30
   10    24    >   INIT_FCALL                                               'str_replace'
         25        SEND_VAL                                                 <array>
         26        SEND_VAL                                                 '+'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !0, $17
   12    30    >   INIT_FCALL                                               'str_replace'
         31        SEND_VAL                                                 <array>
         32        SEND_VAL                                                 '+'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $19     
         35        ASSIGN                                                   !0, $19
   13    36        INIT_FCALL                                               'preg_replace'
         37        SEND_VAL                                                 '%2F%5B%5C%21%5C-%5C%5E%5D%2B%28%3F%21%5Cw%29%2F'
         38        SEND_VAL                                                 '+'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $21     
         41        ASSIGN                                                   !0, $21
   14    42      > RETURN                                                   null

End of function sphinxesc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.86 ms | 1403 KiB | 18 Q