3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeIdFromString(string $str, string$id):string { return str_replace([$id, ',,'], ['',','], $str); } $str = "3,5,7,9"; echo removeIdFromString($str,7);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qBP9q
function name:  (null)
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, '3%2C5%2C7%2C9'
    9     1        INIT_FCALL                                               'removeidfromstring'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 7
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function removeidfromstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qBP9q
function name:  removeIdFromString
number of ops:  13
compiled vars:  !0 = $str, !1 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'str_replace'
          3        INIT_ARRAY                                       ~2      !1
          4        ADD_ARRAY_ELEMENT                                ~2      '%2C%2C'
          5        SEND_VAL                                                 ~2
          6        SEND_VAL                                                 <array>
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        VERIFY_RETURN_TYPE                                       $3
         10      > RETURN                                                   $3
    6    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function removeidfromstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
477.86 ms | 1003 KiB | 15 Q