3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Start Test, the data follows.<br><br>\n"; if ($fp = fopen("text.txt", "r")) { $contents = fread($fp, filesize("text.txt")); echo "$contents"; fclose($fp); } echo "\n<br><br>The data is about to be passed to preg_match(). If you do not see the word 'Success' after this line, the program has crashed.<br>\n"; $truefalsetest=preg_match('%^(?: [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*$%xs', $contents); echo "Success. Return value of preg_match() = $truefalsetest."; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/pheTX
function name:  (null)
number of ops:  31
compiled vars:  !0 = $fp, !1 = $contents, !2 = $truefalsetest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'Start+Test%2C+the+data+follows.%3Cbr%3E%3Cbr%3E%0A'
    3     1        INIT_FCALL                                               'fopen'
          2        SEND_VAL                                                 'text.txt'
          3        SEND_VAL                                                 'r'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                           ~4      !0, $3
          6      > JMPZ                                                     ~4, ->20
    4     7    >   INIT_FCALL                                               'fread'
          8        SEND_VAR                                                 !0
          9        INIT_FCALL                                               'filesize'
         10        SEND_VAL                                                 'text.txt'
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !1, $6
    5    15        CAST                                          6  ~8      !1
         16        ECHO                                                     ~8
    6    17        INIT_FCALL                                               'fclose'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
    8    20    >   ECHO                                                     '%0A%3Cbr%3E%3Cbr%3EThe+data+is+about+to+be+passed+to+preg_match%28%29.+If+you+do+not+see+the+word+%27Success%27+after+this+line%2C+the+program+has+crashed.%3Cbr%3E%0A'
    9    21        INIT_FCALL                                               'preg_match'
         22        SEND_VAL                                                 '%25%5E%28%3F%3A%0A+++++++++%5B%5Cx09%5Cx0A%5Cx0D%5Cx20-%5Cx7E%5D++++++++++++%23+ASCII%0A+++++++%7C+%5B%5CxC2-%5CxDF%5D%5B%5Cx80-%5CxBF%5D++++++++++++%23+non-overlong+2-byte%0A+++++++%7C++%5CxE0%5B%5CxA0-%5CxBF%5D%5B%5Cx80-%5CxBF%5D++++++++%23+excluding+overlongs%0A+++++++%7C+%5B%5CxE1-%5CxEC%5CxEE%5CxEF%5D%5B%5Cx80-%5CxBF%5D%7B2%7D++%23+straight+3-byte%0A+++++++%7C++%5CxED%5B%5Cx80-%5Cx9F%5D%5B%5Cx80-%5CxBF%5D++++++++%23+excluding+surrogates%0A+++++++%7C++%5CxF0%5B%5Cx90-%5CxBF%5D%5B%5Cx80-%5CxBF%5D%7B2%7D++++%23+planes+1-3%0A+++++++%7C+%5B%5CxF1-%5CxF3%5D%5B%5Cx80-%5CxBF%5D%7B3%7D++++++++++%23+planes+4-15%0A+++++++%7C++%5CxF4%5B%5Cx80-%5Cx8F%5D%5B%5Cx80-%5CxBF%5D%7B2%7D++++%23+plane+16%0A+++%29%2A%24%25xs'
   18    23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $10     
    9    25        ASSIGN                                                   !2, $10
   19    26        ROPE_INIT                                     3  ~13     'Success.+Return+value+of+preg_match%28%29+%3D+'
         27        ROPE_ADD                                      1  ~13     ~13, !2
         28        ROPE_END                                      2  ~12     ~13, '.'
         29        ECHO                                                     ~12
   20    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.67 ms | 1396 KiB | 23 Q