3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldpost = "345,346,347"; $posts = explode(",",$oldpost); $index = array_search(346,$posts); if($index !== false){ unset($posts[$index]); } $new_post = implode(",",$posts); echo $new_post;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/qvSEN
function name:  (null)
number of ops:  21
compiled vars:  !0 = $oldpost, !1 = $posts, !2 = $index, !3 = $new_post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '345%2C346%2C347'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        INIT_FCALL                                               'array_search'
          7        SEND_VAL                                                 346
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
    8    11        TYPE_CHECK                                  1018          !2
         12      > JMPZ                                                     ~9, ->14
    9    13    >   UNSET_DIM                                                !1, !2
   12    14    >   INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !3, $10
   14    19        ECHO                                                     !3
   15    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.68 ms | 1395 KiB | 19 Q