3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mystr_replace($needle,$replace,$haystack,&$count=null){ $args = func_get_args(); 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/BG07A
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'mystr_replace'
          1        SEND_VAL                                                 'frop'
          2        SEND_VAL                                                 'frml'
          3        SEND_VAL                                                 'frop'
          4        SEND_VAL_EX                                              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 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BG07A
function name:  mystr_replace
number of ops:  23
compiled vars:  !0 = $needle, !1 = $replace, !2 = $haystack, !3 = $count, !4 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
    3     4        FUNC_GET_ARGS                                    ~5      
          5        ASSIGN                                                   !4, ~5
    4     6        TYPE_CHECK                                    2          !3
          7      > JMPZ                                                     ~7, ->15
    5     8    >   INIT_FCALL                                               'str_replace'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $8      
         13      > RETURN                                                   $8
         14*       JMP                                                      ->22
    7    15    >   INIT_FCALL                                               'str_replace'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !2
         19        SEND_REF                                                 !3
         20        DO_ICALL                                         $9      
         21      > RETURN                                                   $9
    9    22*     > RETURN                                                   null

End of function mystr_replace

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.02 ms | 1399 KiB | 16 Q