3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testing_string = "OFFER_TYPE_1"; $array = explode("_", $testing_string); var_dump($array); $index = intval(end($array))-1; //array index start from 0, while for user readability index starts at 1 unset($array[key($array)]); echo implode("_", $array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iqffD
function name:  (null)
number of ops:  25
compiled vars:  !0 = $testing_string, !1 = $array, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'OFFER_TYPE_1'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '_'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    6     9        INIT_FCALL                                               'end'
         10        SEND_REF                                                 !1
         11        DO_ICALL                                         $7      
         12        CAST                                          4  ~8      $7
         13        SUB                                              ~9      ~8, 1
         14        ASSIGN                                                   !2, ~9
    7    15        INIT_FCALL                                               'key'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $11     
         18        UNSET_DIM                                                !1, $11
    8    19        INIT_FCALL                                               'implode'
         20        SEND_VAL                                                 '_'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $12     
         23        ECHO                                                     $12
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.82 ms | 1395 KiB | 23 Q