3v4l.org

run code in 300+ PHP versions simultaneously
<?php $main_string = "23/CSE/4/2014"; $sub_string = "CSE/4/2014"; echo str_replace($sub_string, '', $main_string); echo "\n"; $main_string = "CSE/4/2014/23"; $sub_string = "CSE/4/2014"; echo trim(str_replace($sub_string, '', $main_string), '/');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZETgL
function name:  (null)
number of ops:  22
compiled vars:  !0 = $main_string, !1 = $sub_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '23%2FCSE%2F4%2F2014'
    3     1        ASSIGN                                                   !1, 'CSE%2F4%2F2014'
    5     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ECHO                                                     $4
    6     8        ECHO                                                     '%0A'
    8     9        ASSIGN                                                   !0, 'CSE%2F4%2F2014%2F23'
    9    10        ASSIGN                                                   !1, 'CSE%2F4%2F2014'
   11    11        INIT_FCALL                                               'trim'
         12        INIT_FCALL                                               'str_replace'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        SEND_VAL                                                 '%2F'
         19        DO_ICALL                                         $8      
         20        ECHO                                                     $8
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.21 ms | 1395 KiB | 17 Q