3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const NBSP = "\\xa0"; public function __construct($value) { var_dump(preg_replace('/'.self::NBSP.'/u', '*', $value)); } } new Foo("foo bar"); new Foo("foo\xc2\xa0bar");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFIUa
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $0      'Foo'
          1        SEND_VAL_EX                                              'foo%C2%A0bar'
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
   13     4        NEW                                              $2      'Foo'
          5        SEND_VAL_EX                                              'foo%C2%A0bar'
          6        DO_FCALL                                      0          
          7        FREE                                                     $2
          8      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFIUa
function name:  __construct
number of ops:  10
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5Cxa0%2Fu'
          4        SEND_VAL                                                 '%2A'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
    9     9      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
258.13 ms | 1016 KiB | 15 Q