3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = '..hel...lo....wor.......ld.......'; echo 'Original: ', $filename, "\n"; $filename = preg_replace( '/\.{2,}/', '.', $filename ); echo 'After preg_replace(): ', $filename, "\n"; $filename = rtrim( $filename, '.' ); echo 'After rtrim(): ', $filename, "\n"; $filename .= '.png'; echo 'Final: ', $filename;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AeAuO
function name:  (null)
number of ops:  25
compiled vars:  !0 = $filename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '..hel...lo....wor.......ld.......'
    4     1        ECHO                                                     'Original%3A+++++++++++++'
          2        ECHO                                                     !0
          3        ECHO                                                     '%0A'
    6     4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F%5C.%7B2%2C%7D%2F'
          6        SEND_VAL                                                 '.'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $2      
          9        ASSIGN                                                   !0, $2
    7    10        ECHO                                                     'After+preg_replace%28%29%3A+'
         11        ECHO                                                     !0
         12        ECHO                                                     '%0A'
    9    13        INIT_FCALL                                               'rtrim'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '.'
         16        DO_ICALL                                         $4      
         17        ASSIGN                                                   !0, $4
   10    18        ECHO                                                     'After+rtrim%28%29%3A++++++++'
         19        ECHO                                                     !0
         20        ECHO                                                     '%0A'
   12    21        ASSIGN_OP                                     8          !0, '.png'
   13    22        ECHO                                                     'Final%3A++++++++++++++++'
         23        ECHO                                                     !0
   14    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.81 ms | 953 KiB | 15 Q