3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text='1'; echo IHateStrReplace(".","_",$text); function IHateStrReplace($replace_from,$replace_to,$input) { $result=""; for($i=0;$i<strlen($input);$i++) { $result.= ($input[$i]==$replace_from)?$replace_to:$input[$i]; } return $result; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BAmld
function name:  (null)
number of ops:  8
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1'
    5     1        INIT_FCALL_BY_NAME                                       'IHateStrReplace'
          2        SEND_VAL_EX                                              '.'
          3        SEND_VAL_EX                                              '_'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $2      
          6        ECHO                                                     $2
   17     7      > RETURN                                                   1

Function ihatestrreplace:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
Branch analysis from position: 6
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
Branch analysis from position: 6
filename:       /in/BAmld
function name:  IHateStrReplace
number of ops:  20
compiled vars:  !0 = $replace_from, !1 = $replace_to, !2 = $input, !3 = $result, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN                                                   !3, ''
   11     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->15
   13     6    >   FETCH_DIM_R                                      ~7      !2, !4
          7        IS_EQUAL                                                 !0, ~7
          8      > JMPZ                                                     ~8, ->11
          9    >   QM_ASSIGN                                        ~9      !1
         10      > JMP                                                      ->13
         11    >   FETCH_DIM_R                                      ~10     !2, !4
         12        QM_ASSIGN                                        ~9      ~10
         13    >   ASSIGN_OP                                     8          !3, ~9
   11    14        PRE_INC                                                  !4
         15    >   STRLEN                                           ~13     !2
         16        IS_SMALLER                                               !4, ~13
         17      > JMPNZ                                                    ~14, ->6
   16    18    > > RETURN                                                   !3
   17    19*     > RETURN                                                   null

End of function ihatestrreplace

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.66 ms | 1395 KiB | 13 Q