3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'HP ProBook 450 G5 15.6 inch i5-8250U - 4LT51EA#ABB - Black'; $find = array('/\s+inch\s+(i[357])-\w+/', '/(\w+)#\w+/'); $replace = array('" $1', '$1'); $result = preg_replace($find, $replace, $string); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/34bSM
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $find, !2 = $replace, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'HP+ProBook+450+G5+15.6+inch+i5-8250U+-+4LT51EA%23ABB+-+Black'
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    7     9        ECHO                                                     !3
    8    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.95 ms | 1398 KiB | 15 Q