3v4l.org

run code in 500+ PHP versions simultaneously
<?php $res_events = "|2,20171021|1,20171007|2,20171007|1,20171028|2,20171014|1,20171014|2,20171028|1,20171021|"; $arr = explode("|", $res_events); Sort($arr); // Remove one of the two empty values in array Unset($arr[0]); // Implode and add last "|" $new =implode("|", $arr)."|"; Echo $new;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DIYYX
function name:  (null)
number of ops:  15
compiled vars:  !0 = $res_events, !1 = $arr, !2 = $new
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%7C2%2C20171021%7C1%2C20171007%7C2%2C20171007%7C1%2C20171028%7C2%2C20171014%7C1%2C20171014%7C2%2C20171028%7C1%2C20171021%7C'
    4     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%7C'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !1, $4
    6     6        INIT_FCALL                                                   'sort'
          7        SEND_REF                                                     !1
          8        DO_ICALL                                                     
    8     9        UNSET_DIM                                                    !1, 0
   10    10        FRAMELESS_ICALL_2                implode             ~7      '%7C', !1
         11        CONCAT                                               ~8      ~7, '%7C'
         12        ASSIGN                                                       !2, ~8
   11    13        ECHO                                                         !2
         14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.29 ms | 2311 KiB | 15 Q