3v4l.org

run code in 500+ 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:  14
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        FRAMELESS_ICALL_3                preg_replace        ~7      !1, '%242'
          7        OP_DATA                                                      !0
          8        ASSIGN                                                       !2, ~7
    6     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !0
         11        SEND_VAR                                                     !2
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.83 ms | 1592 KiB | 17 Q