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, 423!$g%$#dfas--543*@ 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/hF5UH
function name:  (null)
number of ops:  30
compiled vars:  !0 = $str, !1 = $g, !2 = $a, !3 = $str2, !4 = $str3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ROPE_INIT                                     3  ~6      '1_1341383124_Photo+%2FJul+%04%2C+423%21'
          1        ROPE_ADD                                      1  ~6      ~6, !1
          2        ROPE_END                                      2  ~5      ~6, '%25%24%23dfas--543%2A%40+1+22+02+AM_20130724204332.png'
          3        ASSIGN                                                   !0, ~5
    4     4        INIT_FCALL                                               'strrpos'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '.'
          7        DO_ICALL                                         $9      
          8        ASSIGN                                           ~10     !2, $9
          9        ECHO                                                     ~10
    5    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !3, $11
    6    16        INIT_FCALL                                               'preg_replace'
         17        SEND_VAL                                                 '%2F%5B-%2C+%3A%3B.%5C%2F%23%21%40%24%25%5E%2A-%5D%2F'
         18        SEND_VAL                                                 '_'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !4, $13
    7    22        INIT_FCALL                                               'preg_replace'
         23        SEND_VAL                                                 '%2F%5B_%5D%2B%2F'
         24        SEND_VAL                                                 '_'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !4, $15
    8    28        ECHO                                                     !4
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.74 ms | 1395 KiB | 19 Q