3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $str = "1_1341383124_Photo /Jul 04, 1 22 02 AM_20130724204332.png"; echo $a = strrpos($str,"."); $str2 = substr($str,0,$a); $str3 = preg_replace("/[-, :;.\/]/","_",$str2); $str3 = preg_replace("/[_]+/","_",$str3); echo $str3;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tMmXW
function name:  (null)
number of ops:  27
compiled vars:  !0 = $str, !1 = $a, !2 = $str2, !3 = $str3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1_1341383124_Photo+%2FJul+04%2C+1+22+02+AM_20130724204332.png'
    4     1        INIT_FCALL                                               'strrpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                           ~6      !1, $5
          6        ECHO                                                     ~6
    5     7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
    6    13        INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%5B-%2C+%3A%3B.%5C%2F%5D%2F'
         15        SEND_VAL                                                 '_'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $9      
         18        ASSIGN                                                   !3, $9
    7    19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAL                                                 '%2F%5B_%5D%2B%2F'
         21        SEND_VAL                                                 '_'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $11     
         24        ASSIGN                                                   !3, $11
    8    25        ECHO                                                     !3
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.08 ms | 1395 KiB | 19 Q