3v4l.org

run code in 300+ PHP versions simultaneously
<?php $MsgAry1 = ["A","B","C","D","E","F","G","H","I","J", "K","L","M","N","O","P","Q","R","S","T", "U","V","W","X","Y","Z","a","b","c","d", "e","f","g","h","i","j","k","l","m","n", "o","p","q","r","s","t","u","v","w","x", "y","z","1","2","3","4","5","6","7","8", "9","0",".",",","'","?","!"," ","_","-"]; $strings = [ 'test', '1234', 'w0ws3r!', '##tag##', "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'?! _-" ]; foreach ($strings as $string) { echo "$string match: " . var_export(!preg_match('~[^\w.,\'?! -]~', $string), true) . "\n"; echo "$string ltrim: " . var_export(!strlen(ltrim($string, implode($MsgAry1))), true) . "\n"; echo "$string ranged ltrim, chars remaining: \"" . ltrim($string, 'A..Za..z0..9.,\'?! _-') . "\"\n---\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 46
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 46
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
filename:       /in/Hr4M6
function name:  (null)
number of ops:  48
compiled vars:  !0 = $MsgAry1, !1 = $strings, !2 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   19     2      > FE_RESET_R                                       $5      !1, ->46
          3    > > FE_FETCH_R                                               $5, !2, ->46
   20     4    >   NOP                                                      
          5        FAST_CONCAT                                      ~6      !2, '+match%3A+'
          6        INIT_FCALL                                               'var_export'
          7        INIT_FCALL                                               'preg_match'
          8        SEND_VAL                                                 '%7E%5B%5E%5Cw.%2C%27%3F%21+-%5D%7E'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $7      
         11        BOOL_NOT                                         ~8      $7
         12        SEND_VAL                                                 ~8
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $9      
         15        CONCAT                                           ~10     ~6, $9
         16        CONCAT                                           ~11     ~10, '%0A'
         17        ECHO                                                     ~11
   21    18        NOP                                                      
         19        FAST_CONCAT                                      ~12     !2, '+ltrim%3A++'
         20        INIT_FCALL                                               'var_export'
         21        INIT_FCALL                                               'ltrim'
         22        SEND_VAR                                                 !2
         23        INIT_FCALL                                               'implode'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $13     
         26        SEND_VAR                                                 $13
         27        DO_ICALL                                         $14     
         28        STRLEN                                           ~15     $14
         29        BOOL_NOT                                         ~16     ~15
         30        SEND_VAL                                                 ~16
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $17     
         33        CONCAT                                           ~18     ~12, $17
         34        CONCAT                                           ~19     ~18, '%0A'
         35        ECHO                                                     ~19
   22    36        NOP                                                      
         37        FAST_CONCAT                                      ~20     !2, '+ranged+ltrim%2C+chars+remaining%3A+%22'
         38        INIT_FCALL                                               'ltrim'
         39        SEND_VAR                                                 !2
         40        SEND_VAL                                                 'A..Za..z0..9.%2C%27%3F%21+_-'
         41        DO_ICALL                                         $21     
         42        CONCAT                                           ~22     ~20, $21
         43        CONCAT                                           ~23     ~22, '%22%0A---%0A'
         44        ECHO                                                     ~23
   19    45      > JMP                                                      ->3
         46    >   FE_FREE                                                  $5
   23    47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.7 ms | 1400 KiB | 21 Q