3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mystr_replace($needle,$replace,$haystack){ $args = func_get_args(); $count = $args[3]; if(is_null($count)) { return str_replace($needle,$replace,$haystack); } else { return str_replace($needle,$replace,$haystack,$count); } } echo mystr_replace("frop","frml","frop",1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GHvsX
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'mystr_replace'
          1        SEND_VAL                                                 'frop'
          2        SEND_VAL                                                 'frml'
          3        SEND_VAL                                                 'frop'
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0  $0      
          6        ECHO                                                     $0
          7      > RETURN                                                   1

Function mystr_replace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GHvsX
function name:  mystr_replace
number of ops:  24
compiled vars:  !0 = $needle, !1 = $replace, !2 = $haystack, !3 = $args, !4 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        FUNC_GET_ARGS                                    ~5      
          4        ASSIGN                                                   !3, ~5
    4     5        FETCH_DIM_R                                      ~7      !3, 3
          6        ASSIGN                                                   !4, ~7
    5     7        TYPE_CHECK                                    2          !4
          8      > JMPZ                                                     ~9, ->16
    6     9    >   INIT_FCALL                                               'str_replace'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $10     
         14      > RETURN                                                   $10
         15*       JMP                                                      ->23
    8    16    >   INIT_FCALL                                               'str_replace'
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !2
         20        SEND_REF                                                 !4
         21        DO_ICALL                                         $11     
         22      > RETURN                                                   $11
   10    23*     > RETURN                                                   null

End of function mystr_replace

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.65 ms | 1390 KiB | 16 Q