3v4l.org

run code in 500+ 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:  10
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_ARRAY                                           ~2      !1
          3        ADD_ARRAY_ELEMENT                                    ~2      '%2C%2C'
          4        FRAMELESS_ICALL_3                str_replace         ~3      ~2, <array>
          5        OP_DATA                                                      !0
          6        VERIFY_RETURN_TYPE                                           ~3
          7      > RETURN                                                       ~3
    6     8*       VERIFY_RETURN_TYPE                                           
          9*     > RETURN                                                       null

End of function removeidfromstring

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.27 ms | 3311 KiB | 14 Q