3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "bla_string_bla_bla_bla"; $prefix = 'bla_'; $str = preg_replace('#^' . preg_quote($prefix) . '#', '', $str); var_export($str); echo "\n---\n"; $str = "string_bla_bla_bla"; $str = preg_replace('#^' . preg_quote($prefix) . '#', '', $str); var_export($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ule6O
function name:  (null)
number of ops:  33
compiled vars:  !0 = $str, !1 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'bla_string_bla_bla_bla'
    4     1        ASSIGN                                                   !1, 'bla_'
    5     2        INIT_FCALL                                               'preg_replace'
          3        INIT_FCALL                                               'preg_quote'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        CONCAT                                           ~5      '%23%5E', $4
          7        CONCAT                                           ~6      ~5, '%23'
          8        SEND_VAL                                                 ~6
          9        SEND_VAL                                                 ''
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
    6    13        INIT_FCALL                                               'var_export'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
    8    16        ECHO                                                     '%0A---%0A'
   10    17        ASSIGN                                                   !0, 'string_bla_bla_bla'
   11    18        INIT_FCALL                                               'preg_replace'
         19        INIT_FCALL                                               'preg_quote'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $11     
         22        CONCAT                                           ~12     '%23%5E', $11
         23        CONCAT                                           ~13     ~12, '%23'
         24        SEND_VAL                                                 ~13
         25        SEND_VAL                                                 ''
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $14     
         28        ASSIGN                                                   !0, $14
   12    29        INIT_FCALL                                               'var_export'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.6 ms | 1003 KiB | 16 Q