3v4l.org

run code in 300+ PHP versions simultaneously
<?php $whitespaces = [ 'character tabulation' => "\u{0009}", 'line feed' => "\u{000A}", 'line tabulation' => "\u{000B}", 'form feed' => "\u{000C}", 'carriage return' => "\u{000D}", 'space' => "\u{0020}", 'next line' => "\u{0085}", 'no-break space' => "\u{00A0}", 'ogham space mark' => "\u{1680}", 'mongolian vowel separator' => "\u{180E}", 'en quad' => "\u{2000}", 'em quad' => "\u{2001}", 'en space' => "\u{2002}", 'em space' => "\u{2003}", 'three-per-em space' => "\u{2004}", 'four-per-em space' => "\u{2005}", 'six-per-em space' => "\u{2006}", 'figure space' => "\u{2007}", 'punctuation space' => "\u{2008}", 'thin space' => "\u{2009}", 'hair space' => "\u{200A}", 'zero width space' => "\u{200B}", 'zero width non-joiner' => "\u{200C}", 'zero width joiner' => "\u{200D}", 'line separator' => "\u{2028}", 'paragraph separator' => "\u{2029}", 'narrow no-break space' => "\u{202F}", 'medium mathematical space' => "\u{205F}", 'word joiner' => "\u{2060}", 'ideographic space' => "\u{3000}", 'zero width non-breaking space' => "\u{FEFF}" ]; $patterns = [ '/\s+/', '/\s+/u', '/\pZ+/u', '/\pC+/u', '/[\pZ\pC]+/u', '/[\x{0009}-\x{000D}\x{0020}\x{0085}\x{00A0}\x{1680}\x{180E}\x{2000}-\x{200D}\x{2028}-\x{202F}\x{205F}\x{2060}\x{3000}\x{FEFF}]+/ux', ]; printf("\n|%-30s |", 'whitespace characters'); foreach ($patterns as $pattern) { printf(" %-12s |", $pattern); } printf("\n|%s%s|", str_repeat('-', 31), str_repeat('|:' . str_repeat('-', 12) . ':', count($patterns))); foreach ($whitespaces as $name => $char) { printf("\n|%30s |", $name); foreach ($patterns as $pattern) { printf(" %-13s |", mb_strlen(preg_replace($pattern, '', $char)) ? '❌' : '✅'); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 35, Position 2 = 62
Branch analysis from position: 35
2 jumps found. (Code = 78) Position 1 = 36, Position 2 = 62
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 60
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 60
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 60
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
Branch analysis from position: 13
filename:       /in/3g0Yk
function name:  (null)
number of ops:  64
compiled vars:  !0 = $whitespaces, !1 = $patterns, !2 = $pattern, !3 = $char, !4 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   37     1        ASSIGN                                                   !1, <array>
   46     2        INIT_FCALL                                               'printf'
          3        SEND_VAL                                                 '%0A%7C%25-30s+%7C'
          4        SEND_VAL                                                 'whitespace+characters'
          5        DO_ICALL                                                 
   47     6      > FE_RESET_R                                       $8      !1, ->13
          7    > > FE_FETCH_R                                               $8, !2, ->13
   48     8    >   INIT_FCALL                                               'printf'
          9        SEND_VAL                                                 '+%25-12s+%7C'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   47    12      > JMP                                                      ->7
         13    >   FE_FREE                                                  $8
   51    14        INIT_FCALL                                               'printf'
         15        SEND_VAL                                                 '%0A%7C%25s%25s%7C'
         16        INIT_FCALL                                               'str_repeat'
         17        SEND_VAL                                                 '-'
         18        SEND_VAL                                                 31
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        INIT_FCALL                                               'str_repeat'
         22        INIT_FCALL                                               'str_repeat'
         23        SEND_VAL                                                 '-'
         24        SEND_VAL                                                 12
         25        DO_ICALL                                         $11     
         26        CONCAT                                           ~12     '%7C%3A', $11
         27        CONCAT                                           ~13     ~12, '%3A'
         28        SEND_VAL                                                 ~13
         29        COUNT                                            ~14     !1
         30        SEND_VAL                                                 ~14
         31        DO_ICALL                                         $15     
         32        SEND_VAR                                                 $15
         33        DO_ICALL                                                 
   53    34      > FE_RESET_R                                       $17     !0, ->62
         35    > > FE_FETCH_R                                       ~18     $17, !3, ->62
         36    >   ASSIGN                                                   !4, ~18
   54    37        INIT_FCALL                                               'printf'
         38        SEND_VAL                                                 '%0A%7C%2530s+%7C'
         39        SEND_VAR                                                 !4
         40        DO_ICALL                                                 
   55    41      > FE_RESET_R                                       $21     !1, ->60
         42    > > FE_FETCH_R                                               $21, !2, ->60
   56    43    >   INIT_FCALL                                               'printf'
         44        SEND_VAL                                                 '+%25-13s+%7C'
         45        INIT_FCALL                                               'mb_strlen'
         46        INIT_FCALL                                               'preg_replace'
         47        SEND_VAR                                                 !2
         48        SEND_VAL                                                 ''
         49        SEND_VAR                                                 !3
         50        DO_ICALL                                         $22     
         51        SEND_VAR                                                 $22
         52        DO_ICALL                                         $23     
         53      > JMPZ                                                     $23, ->56
         54    >   QM_ASSIGN                                        ~24     '%E2%9D%8C'
         55      > JMP                                                      ->57
         56    >   QM_ASSIGN                                        ~24     '%E2%9C%85'
         57    >   SEND_VAL                                                 ~24
         58        DO_ICALL                                                 
   55    59      > JMP                                                      ->42
         60    >   FE_FREE                                                  $21
   53    61      > JMP                                                      ->35
         62    >   FE_FREE                                                  $17
   58    63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.98 ms | 1010 KiB | 17 Q