3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'c1, c3, C5 DESC'; $order = "DESC"; $c = explode(",", $str); $s = preg_replace('/{$order}$/', '', $c[2]); var_dump($s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8ZEdP
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $order, !2 = $c, !3 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'c1%2C+c3%2C+C5+DESC'
    4     1        ASSIGN                                                   !1, 'DESC'
    5     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    6     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%7B%24order%7D%24%2F'
          9        SEND_VAL                                                 ''
         10        FETCH_DIM_R                                      ~8      !2, 2
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
    7    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.14 ms | 1394 KiB | 19 Q