3v4l.org

run code in 300+ PHP versions simultaneously
<?php $files = [ [ "name" => "testä.jpg" ], [ "name" => "test.jpg" ], [ "name" => "ä" ] ]; foreach ($files as $file) { $filename = $file['name']; if (!preg_match('/^[\w.-]+$/i', $filename)) { echo "Error for: $filename" . PHP_EOL; } else { echo "No error for: $filename" . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/2Jvk0
function name:  (null)
number of ops:  23
compiled vars:  !0 = $files, !1 = $file, !2 = $filename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1      > FE_RESET_R                                       $4      !0, ->21
          2    > > FE_FETCH_R                                               $4, !1, ->21
   16     3    >   FETCH_DIM_R                                      ~5      !1, 'name'
          4        ASSIGN                                                   !2, ~5
   17     5        INIT_FCALL                                               'preg_match'
          6        SEND_VAL                                                 '%2F%5E%5B%5Cw.-%5D%2B%24%2Fi'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        BOOL_NOT                                         ~8      $7
         10      > JMPZ                                                     ~8, ->16
   18    11    >   NOP                                                      
         12        FAST_CONCAT                                      ~9      'Error+for%3A+', !2
         13        CONCAT                                           ~10     ~9, '%0A'
         14        ECHO                                                     ~10
   17    15      > JMP                                                      ->20
   20    16    >   NOP                                                      
         17        FAST_CONCAT                                      ~11     'No+error+for%3A+', !2
         18        CONCAT                                           ~12     ~11, '%0A'
         19        ECHO                                                     ~12
   15    20    > > JMP                                                      ->2
         21    >   FE_FREE                                                  $4
   22    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.69 ms | 1010 KiB | 14 Q