3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); $string = 'JavaSCRIPT and pHp are testing test-ground for TEST !'; $censor = ['php' => 2,'javascript' => 2,'test' => 3]; foreach ($censor as $word => $position) { while (($pos = stripos($string, $word)) !== false) { $string = substr_replace($string, '*', $pos + $position - 1, 1); } } echo $string; $end = (microtime(true)); echo '<br />'; echo $end - $start;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
Branch analysis from position: 10
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/NVp6S
function name:  (null)
number of ops:  37
compiled vars:  !0 = $start, !1 = $string, !2 = $censor, !3 = $position, !4 = $word, !5 = $pos, !6 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
    3     4        ASSIGN                                                   !1, 'JavaSCRIPT+and+pHp+are+testing+test-ground+for+TEST+%21'
    5     5        ASSIGN                                                   !2, <array>
    6     6      > FE_RESET_R                                       $11     !2, ->27
          7    > > FE_FETCH_R                                       ~12     $11, !3, ->27
          8    >   ASSIGN                                                   !4, ~12
    7     9      > JMP                                                      ->19
    8    10    >   INIT_FCALL                                               'substr_replace'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 '%2A'
         13        ADD                                              ~14     !5, !3
         14        SUB                                              ~15     ~14, 1
         15        SEND_VAL                                                 ~15
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !1, $16
    7    19    >   INIT_FCALL                                               'stripos'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                         $18     
         23        ASSIGN                                           ~19     !5, $18
         24        TYPE_CHECK                                  1018          ~19
         25      > JMPNZ                                                    ~20, ->10
    6    26    > > JMP                                                      ->7
         27    >   FE_FREE                                                  $11
   12    28        ECHO                                                     !1
   13    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $21     
         32        ASSIGN                                                   !6, $21
   14    33        ECHO                                                     '%3Cbr+%2F%3E'
   15    34        SUB                                              ~23     !6, !0
         35        ECHO                                                     ~23
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.29 ms | 1400 KiB | 19 Q