3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "This string contains some unwanted characters on the end."; $text1 = rtrim($text, 'a..z'); $text1 = rtrim($text1, '.'); echo $text1; // only the '.' is trimmed. echo '<br />'; $text2 = rtrim($text, 'a..z.'); echo $text2; // The whole last word is trimmed.
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hhbBl
function name:  (null)
number of ops:  20
compiled vars:  !0 = $text, !1 = $text1, !2 = $text2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+string+contains+some+unwanted+characters+on+the+end.'
    4     1        INIT_FCALL                                               'rtrim'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'a..z'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'rtrim'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 '.'
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    6    11        ECHO                                                     !1
    7    12        ECHO                                                     '%3Cbr+%2F%3E'
    8    13        INIT_FCALL                                               'rtrim'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 'a..z.'
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !2, $8
    9    18        ECHO                                                     !2
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.85 ms | 1395 KiB | 15 Q