3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'a,b,c,d,e'; $arr = explode( ',', $str); $last = array_pop( $arr); $arr[] = array_pop( $arr) . $last; echo implode( ',', $arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PD0Qd
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str, !1 = $arr, !2 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'a%2Cb%2Cc%2Cd%2Ce'
    3     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    4     6        INIT_FCALL                                               'array_pop'
          7        SEND_REF                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
    5    10        INIT_FCALL                                               'array_pop'
         11        SEND_REF                                                 !1
         12        DO_ICALL                                         $9      
         13        CONCAT                                           ~10     $9, !2
         14        ASSIGN_DIM                                               !1
         15        OP_DATA                                                  ~10
    6    16        INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '%2C'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $11     
         20        ECHO                                                     $11
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.74 ms | 1395 KiB | 19 Q