3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = html_entity_decode("&nbsp;"); print "The Problem: \n\n"; print ORD($string[0]); print "\n"; print ORD($string[1]); print "\n\n"; $string1 = str_replace("\u{c2a0}", "", $string); $string2 = preg_replace('/^(\\s|\\xC2\\xA0)+|(\\s|\\xC2\\xA0)+$/', '', $string); print "Mark Baker's Solution |" . $string1 . "|\n"; print "Codesmith's Solution |" . $string2 . "|\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TNtk5
function name:  (null)
number of ops:  36
compiled vars:  !0 = $string, !1 = $string1, !2 = $string2
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        ASSIGN                                                   !0, $3
    5     4        ECHO                                                     'The+Problem%3A+%0A%0A'
    7     5        INIT_FCALL                                               'ord'
          6        FETCH_DIM_R                                      ~5      !0, 0
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                         $6      
          9        ECHO                                                     $6
    8    10        ECHO                                                     '%0A'
    9    11        INIT_FCALL                                               'ord'
         12        FETCH_DIM_R                                      ~7      !0, 1
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        ECHO                                                     $8
   11    16        ECHO                                                     '%0A%0A'
   13    17        INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 '%EC%8A%A0'
         19        SEND_VAL                                                 ''
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $9      
         22        ASSIGN                                                   !1, $9
   14    23        INIT_FCALL                                               'preg_replace'
         24        SEND_VAL                                                 '%2F%5E%28%5Cs%7C%5CxC2%5CxA0%29%2B%7C%28%5Cs%7C%5CxC2%5CxA0%29%2B%24%2F'
         25        SEND_VAL                                                 ''
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $11     
         28        ASSIGN                                                   !2, $11
   16    29        CONCAT                                           ~13     'Mark+Baker%27s+Solution+%7C', !1
         30        CONCAT                                           ~14     ~13, '%7C%0A'
         31        ECHO                                                     ~14
   17    32        CONCAT                                           ~15     'Codesmith%27s+Solution+%7C', !2
         33        CONCAT                                           ~16     ~15, '%7C%0A'
         34        ECHO                                                     ~16
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
221.39 ms | 1004 KiB | 17 Q