3v4l.org

run code in 300+ PHP versions simultaneously
<?php $whitespace = array( "\u0009" => 'character tab', "\u000a" => 'line feed', "\u000b" => 'line tab', "\u000c" => 'form feed', "\u000d" => 'carriage return', "\u0020" => 'space', "\u0085" => 'next line', "\u00A0" => 'non-breaking space', "\u1680" => 'ogham space', "\u2000" => 'en quad', "\u2001" => 'em quad', "\u2002" => 'en space', "\u2003" => 'em space', "\u2004" => 'three-per-em space', "\u2005" => 'four-per-em space', "\u2006" => 'six-per-em space', "\u2007" => 'figure space', "\u2008" => 'punctuation space', "\u2009" => 'thin space', "\u200a" => 'hair space', "\u2028" => 'line separator', "\u2029" => 'paragraph separator', "\u202f" => 'narrow non-breaking space', "\u205f" => 'medium mathematical space', "\u3000" => 'ideographic space' ); foreach ($whitespace as $char => $name) { $dec = json_decode('"'.$char.'"'); $test = "a{$dec}b"; $test = preg_replace('/\s+/', '', $test); //echo "$name: a{$char}b == $test\n"; if ($test != "ab") { echo "$char ($name) is not matched as whitespace\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 28
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/fECqg
function name:  (null)
number of ops:  30
compiled vars:  !0 = $whitespace, !1 = $name, !2 = $char, !3 = $dec, !4 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   30     1      > FE_RESET_R                                       $6      !0, ->28
          2    > > FE_FETCH_R                                       ~7      $6, !1, ->28
          3    >   ASSIGN                                                   !2, ~7
   31     4        INIT_FCALL                                               'json_decode'
          5        CONCAT                                           ~9      '%22', !2
          6        CONCAT                                           ~10     ~9, '%22'
          7        SEND_VAL                                                 ~10
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !3, $11
   32    10        ROPE_INIT                                     3  ~14     'a'
         11        ROPE_ADD                                      1  ~14     ~14, !3
         12        ROPE_END                                      2  ~13     ~14, 'b'
         13        ASSIGN                                                   !4, ~13
   33    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                         $17     
         19        ASSIGN                                                   !4, $17
   35    20        IS_NOT_EQUAL                                             !4, 'ab'
         21      > JMPZ                                                     ~19, ->27
   36    22    >   ROPE_INIT                                     4  ~21     !2
         23        ROPE_ADD                                      1  ~21     ~21, '+%28'
         24        ROPE_ADD                                      2  ~21     ~21, !1
         25        ROPE_END                                      3  ~20     ~21, '%29+is+not+matched+as+whitespace%0A'
         26        ECHO                                                     ~20
   30    27    > > JMP                                                      ->2
         28    >   FE_FREE                                                  $6
   38    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.85 ms | 1396 KiB | 17 Q