3v4l.org

run code in 500+ PHP versions simultaneously
<?php $texts = [ '<p>Some <em>valid</em> HTML</p>', '<p>Some <em invalid</em> HTML</p>', '<p>Some <em data="Element stop>">valid</em> HTML which contains a greater than symbol in a data-attribute</p>', ]; $patterns = [ '/(<.+?>)/is', '/(<[^>]+>)/is', ]; foreach ($texts as $text) { print sprintf('HTML: %s', $text) . PHP_EOL . PHP_EOL; foreach ($patterns as $pattern) { print sprintf('%s', $pattern) . PHP_EOL . PHP_EOL; $chunks = preg_split('/(<.+?>)/is', $text, -1, PREG_SPLIT_DELIM_CAPTURE); var_dump($chunks); print PHP_EOL . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 29
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 29
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 27
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/jHa5m
function name:  (null)
number of ops:  31
compiled vars:  !0 = $texts, !1 = $patterns, !2 = $text, !3 = $pattern, !4 = $chunks
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        ASSIGN                                                       !1, <array>
   14     2      > FE_RESET_R                                           $7      !0, ->29
          3    > > FE_FETCH_R                                                   $7, !2, ->29
   15     4    >   NOP                                                          
          5        FAST_CONCAT                                          ~8      'HTML%3A+', !2
          6        CONCAT                                               ~9      ~8, '%0A'
          7        CONCAT                                               ~10     ~9, '%0A'
          8        ECHO                                                         ~10
   17     9      > FE_RESET_R                                           $11     !1, ->27
         10    > > FE_FETCH_R                                                   $11, !3, ->27
   18    11    >   CAST                                              6  ~12     !3
         12        CONCAT                                               ~13     ~12, '%0A'
         13        CONCAT                                               ~14     ~13, '%0A'
         14        ECHO                                                         ~14
   20    15        INIT_FCALL                                                   'preg_split'
         16        SEND_VAL                                                     '%2F%28%3C.%2B%3F%3E%29%2Fis'
         17        SEND_VAR                                                     !2
         18        SEND_VAL                                                     -1
         19        SEND_VAL                                                     2
         20        DO_ICALL                                             $15     
         21        ASSIGN                                                       !4, $15
   21    22        INIT_FCALL                                                   'var_dump'
         23        SEND_VAR                                                     !4
         24        DO_ICALL                                                     
   23    25        ECHO                                                         '%0A%0A'
   17    26      > JMP                                                          ->10
         27    >   FE_FREE                                                      $11
   14    28      > JMP                                                          ->3
         29    >   FE_FREE                                                      $7
   25    30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
244.42 ms | 3615 KiB | 10 Q