3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This should produce failures when using a version of libpcre older than 8.32 */ // Ignore versions other than 5.3-5.5 if (!preg_match('/^5\.[345]\./', phpversion())) { print "Don't care about this version\n"; exit(0); } error_reporting(E_ALL); ob_start(); phpinfo(); $phpinfo = ob_get_clean(); print preg_replace('/.*(PCRE Library Version => .*?$).*/sm', '$1', $phpinfo) . "\n"; $tests = array(); $test_string = mb_convert_encoding('&#x0BA8;&#x0BBF;', 'UTF-8', 'HTML-ENTITIES'); print "$test_string\n"; print strlen($test_string) . "\n"; print mb_strlen($test_string, 'UTF-8') . "\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-8') === 1); $tests['string_match'] = (preg_match('/^\X$/u', $test_string) === 1); $fails = array(); foreach ($tests as $key => $value) { if ($value === false) { $fails[$key] = $value; } } if (count($fails) > 0) { echo "Failed: " . join(', ', array_keys($fails)) . "\n"; exit(1); } exit(0);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 62, Position 2 = 69
Branch analysis from position: 62
2 jumps found. (Code = 78) Position 1 = 63, Position 2 = 69
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
Branch analysis from position: 68
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 84
Branch analysis from position: 73
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 84
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 69
filename:       /in/O6CK7
function name:  (null)
number of ops:  86
compiled vars:  !0 = $phpinfo, !1 = $tests, !2 = $test_string, !3 = $fails, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'preg_match'
          1        SEND_VAL                                                 '%2F%5E5%5C.%5B345%5D%5C.%2F'
          2        INIT_FCALL                                               'phpversion'
          3        DO_ICALL                                         $6      
          4        SEND_VAR                                                 $6
          5        DO_ICALL                                         $7      
          6        BOOL_NOT                                         ~8      $7
          7      > JMPZ                                                     ~8, ->10
    8     8    >   ECHO                                                     'Don%27t+care+about+this+version%0A'
    9     9      > EXIT                                                     0
   12    10    >   INIT_FCALL                                               'error_reporting'
         11        SEND_VAL                                                 32767
         12        DO_ICALL                                                 
   14    13        INIT_FCALL                                               'ob_start'
         14        DO_ICALL                                                 
   15    15        INIT_FCALL                                               'phpinfo'
         16        DO_ICALL                                                 
   16    17        INIT_FCALL                                               'ob_get_clean'
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !0, $12
   17    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAL                                                 '%2F.%2A%28PCRE+Library+Version+%3D%3E+.%2A%3F%24%29.%2A%2Fsm'
         22        SEND_VAL                                                 '%241'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $14     
         25        CONCAT                                           ~15     $14, '%0A'
         26        ECHO                                                     ~15
   19    27        ASSIGN                                                   !1, <array>
   20    28        INIT_FCALL                                               'mb_convert_encoding'
         29        SEND_VAL                                                 '%26%23x0BA8%3B%26%23x0BBF%3B'
         30        SEND_VAL                                                 'UTF-8'
         31        SEND_VAL                                                 'HTML-ENTITIES'
         32        DO_ICALL                                         $17     
         33        ASSIGN                                                   !2, $17
   21    34        NOP                                                      
         35        FAST_CONCAT                                      ~19     !2, '%0A'
         36        ECHO                                                     ~19
   22    37        STRLEN                                           ~20     !2
         38        CONCAT                                           ~21     ~20, '%0A'
         39        ECHO                                                     ~21
   23    40        INIT_FCALL                                               'mb_strlen'
         41        SEND_VAR                                                 !2
         42        SEND_VAL                                                 'UTF-8'
         43        DO_ICALL                                         $22     
         44        CONCAT                                           ~23     $22, '%0A'
         45        ECHO                                                     ~23
   25    46        INIT_FCALL                                               'mb_strlen'
         47        SEND_VAR                                                 !2
         48        SEND_VAL                                                 'UTF-8'
         49        DO_ICALL                                         $25     
         50        IS_IDENTICAL                                     ~26     $25, 1
         51        ASSIGN_DIM                                               !1, 'string_length'
         52        OP_DATA                                                  ~26
   26    53        INIT_FCALL                                               'preg_match'
         54        SEND_VAL                                                 '%2F%5E%5CX%24%2Fu'
         55        SEND_VAR                                                 !2
         56        DO_ICALL                                         $28     
         57        IS_IDENTICAL                                     ~29     $28, 1
         58        ASSIGN_DIM                                               !1, 'string_match'
         59        OP_DATA                                                  ~29
   28    60        ASSIGN                                                   !3, <array>
   29    61      > FE_RESET_R                                       $31     !1, ->69
         62    > > FE_FETCH_R                                       ~32     $31, !4, ->69
         63    >   ASSIGN                                                   !5, ~32
   30    64        TYPE_CHECK                                    4          !4
         65      > JMPZ                                                     ~34, ->68
   31    66    >   ASSIGN_DIM                                               !3, !5
         67        OP_DATA                                                  !4
   29    68    > > JMP                                                      ->62
         69    >   FE_FREE                                                  $31
   35    70        COUNT                                            ~36     !3
         71        IS_SMALLER                                               0, ~36
         72      > JMPZ                                                     ~37, ->84
   36    73    >   INIT_FCALL                                               'join'
         74        SEND_VAL                                                 '%2C+'
         75        INIT_FCALL                                               'array_keys'
         76        SEND_VAR                                                 !3
         77        DO_ICALL                                         $38     
         78        SEND_VAR                                                 $38
         79        DO_ICALL                                         $39     
         80        CONCAT                                           ~40     'Failed%3A+', $39
         81        CONCAT                                           ~41     ~40, '%0A'
         82        ECHO                                                     ~41
   37    83      > EXIT                                                     1
   40    84    > > EXIT                                                     0
         85*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.28 ms | 949 KiB | 36 Q