3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."; $iLoc = strpos($string, 'I'); $mLoc = strpos($string, 'm', $iLoc); $ipsum = substr($string,$iLoc, $mLoc-$iLoc+1); // Replace all Ipsums $string = str_ireplace( $ipsum, 'String', $string); // Loop through string like an array, using the index to replace 's' values for($i = 0; $i < strlen($string); $i++){ if($string[$i] === 's' || $string[$i] === 'S' ){ $string[$i-1] = "\\"; $string[$i] = '$'; } } $string = str_replace( (stristr($string, '\\', true)), 'P_H+?P', $string); var_dump($string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 28
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 47) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 40
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 28
Branch analysis from position: 44
Branch analysis from position: 28
Branch analysis from position: 40
Branch analysis from position: 34
filename:       /in/ZtVme
function name:  (null)
number of ops:  59
compiled vars:  !0 = $string, !1 = $iLoc, !2 = $mLoc, !3 = $ipsum, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Lorem+Ipsum+is+simply+dummy+text+of+the+printing+and+typesetting+industry.+%0ALorem+Ipsum+has+been+the+industry%27s+standard+dummy+text+ever+since+the+1500s%2C+when+an+unknown+printer+took+a+galley+of+%0Atype+and+scrambled+it+to+make+a+type+specimen+book.+It+has+survived+not+only+five+centuries%2C+but+also+the+leap+into+%0Aelectronic+typesetting%2C+remaining+essentially+unchanged.+It+was+popularised+in+the+1960s+with+the+release+of+Letraset+%0Asheets+containing+Lorem+Ipsum+passages%2C+and+more+recently+with+desktop+publishing+software+like+Aldus+PageMaker+%0Aincluding+versions+of+Lorem+Ipsum.'
   10     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'I'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   11     6        INIT_FCALL                                               'strpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'm'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
   12    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        SUB                                              ~10     !2, !1
         16        ADD                                              ~11     ~10, 1
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !3, $12
   15    20        INIT_FCALL                                               'str_ireplace'
   16    21        SEND_VAR                                                 !3
   17    22        SEND_VAL                                                 'String'
   18    23        SEND_VAR                                                 !0
   15    24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !0, $14
   21    26        ASSIGN                                                   !4, 0
         27      > JMP                                                      ->41
   22    28    >   FETCH_DIM_R                                      ~17     !0, !4
         29        IS_IDENTICAL                                     ~18     ~17, 's'
         30      > JMPNZ_EX                                         ~18     ~18, ->34
         31    >   FETCH_DIM_R                                      ~19     !0, !4
         32        IS_IDENTICAL                                     ~20     ~19, 'S'
         33        BOOL                                             ~18     ~20
         34    > > JMPZ                                                     ~18, ->40
   23    35    >   SUB                                              ~21     !4, 1
         36        ASSIGN_DIM                                               !0, ~21
         37        OP_DATA                                                  '%5C'
   24    38        ASSIGN_DIM                                               !0, !4
         39        OP_DATA                                                  '%24'
   21    40    >   PRE_INC                                                  !4
         41    >   STRLEN                                           ~25     !0
         42        IS_SMALLER                                               !4, ~25
         43      > JMPNZ                                                    ~26, ->28
   28    44    >   INIT_FCALL                                               'str_replace'
   29    45        INIT_FCALL                                               'stristr'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 '%5C'
         48        SEND_VAL                                                 <true>
         49        DO_ICALL                                         $27     
         50        SEND_VAR                                                 $27
   30    51        SEND_VAL                                                 'P_H%2B%3FP'
   31    52        SEND_VAR                                                 !0
   28    53        DO_ICALL                                         $28     
         54        ASSIGN                                                   !0, $28
   34    55        INIT_FCALL                                               'var_dump'
         56        SEND_VAR                                                 !0
         57        DO_ICALL                                                 
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.55 ms | 1470 KiB | 19 Q