3v4l.org

run code in 300+ PHP versions simultaneously
<?php $before = html_entity_decode("&nbsp;") . "&nbsp;abc&nbsp;xyz&nbsp;"; $pattern = '~^(\xC2\xA0|&nbsp;)*(.*?)(?1)*$~'; $after = preg_replace($pattern, '$2', $before); var_dump($before, $after);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OjVsl
function name:  (null)
number of ops:  17
compiled vars:  !0 = $before, !1 = $pattern, !2 = $after
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'html_entity_decode'
          1        SEND_VAL                                                 '%26nbsp%3B'
          2        DO_ICALL                                         $3      
          3        CONCAT                                           ~4      $3, '%26nbsp%3Babc%26nbsp%3Bxyz%26nbsp%3B'
          4        ASSIGN                                                   !0, ~4
    4     5        ASSIGN                                                   !1, '%7E%5E%28%5CxC2%5CxA0%7C%26nbsp%3B%29%2A%28.%2A%3F%29%28%3F1%29%2A%24%7E'
    5     6        INIT_FCALL                                               'preg_replace'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 '%242'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
    6    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.26 ms | 1001 KiB | 16 Q