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); } preg_match('/((?:a?)*)*c/', 'aac', $matches); var_export($matches); 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-32', 'HTML-ENTITIES'); print "$test_string\n"; print strlen($test_string) . "\n"; print mb_strlen($test_string, 'UTF-32') . "\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-32') === 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 = 70, Position 2 = 77
Branch analysis from position: 70
2 jumps found. (Code = 78) Position 1 = 71, Position 2 = 77
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 76
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 76
Branch analysis from position: 77
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 92
Branch analysis from position: 81
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 92
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 77
filename:       /in/8dtoI
function name:  (null)
number of ops:  94
compiled vars:  !0 = $matches, !1 = $phpinfo, !2 = $tests, !3 = $test_string, !4 = $fails, !5 = $value, !6 = $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                                         $7      
          4        SEND_VAR                                                 $7
          5        DO_ICALL                                         $8      
          6        BOOL_NOT                                         ~9      $8
          7      > JMPZ                                                     ~9, ->10
    8     8    >   ECHO                                                     'Don%27t+care+about+this+version%0A'
    9     9      > EXIT                                                     0
   12    10    >   INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%28%28%3F%3Aa%3F%29%2A%29%2Ac%2F'
         12        SEND_VAL                                                 'aac'
         13        SEND_REF                                                 !0
         14        DO_ICALL                                                 
   13    15        INIT_FCALL                                               'var_export'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   15    18        INIT_FCALL                                               'error_reporting'
         19        SEND_VAL                                                 32767
         20        DO_ICALL                                                 
   17    21        INIT_FCALL                                               'ob_start'
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'phpinfo'
         24        DO_ICALL                                                 
   19    25        INIT_FCALL                                               'ob_get_clean'
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !1, $15
   20    28        INIT_FCALL                                               'preg_replace'
         29        SEND_VAL                                                 '%2F.%2A%28PCRE+Library+Version+%3D%3E+.%2A%3F%24%29.%2A%2Fsm'
         30        SEND_VAL                                                 '%241'
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $17     
         33        CONCAT                                           ~18     $17, '%0A'
         34        ECHO                                                     ~18
   22    35        ASSIGN                                                   !2, <array>
   23    36        INIT_FCALL                                               'mb_convert_encoding'
         37        SEND_VAL                                                 '%26%23x0BA8%3B%26%23x0BBF%3B'
         38        SEND_VAL                                                 'UTF-32'
         39        SEND_VAL                                                 'HTML-ENTITIES'
         40        DO_ICALL                                         $20     
         41        ASSIGN                                                   !3, $20
   24    42        NOP                                                      
         43        FAST_CONCAT                                      ~22     !3, '%0A'
         44        ECHO                                                     ~22
   25    45        STRLEN                                           ~23     !3
         46        CONCAT                                           ~24     ~23, '%0A'
         47        ECHO                                                     ~24
   26    48        INIT_FCALL                                               'mb_strlen'
         49        SEND_VAR                                                 !3
         50        SEND_VAL                                                 'UTF-32'
         51        DO_ICALL                                         $25     
         52        CONCAT                                           ~26     $25, '%0A'
         53        ECHO                                                     ~26
   28    54        INIT_FCALL                                               'mb_strlen'
         55        SEND_VAR                                                 !3
         56        SEND_VAL                                                 'UTF-32'
         57        DO_ICALL                                         $28     
         58        IS_IDENTICAL                                     ~29     $28, 1
         59        ASSIGN_DIM                                               !2, 'string_length'
         60        OP_DATA                                                  ~29
   29    61        INIT_FCALL                                               'preg_match'
         62        SEND_VAL                                                 '%2F%5E%5CX%24%2Fu'
         63        SEND_VAR                                                 !3
         64        DO_ICALL                                         $31     
         65        IS_IDENTICAL                                     ~32     $31, 1
         66        ASSIGN_DIM                                               !2, 'string_match'
         67        OP_DATA                                                  ~32
   31    68        ASSIGN                                                   !4, <array>
   32    69      > FE_RESET_R                                       $34     !2, ->77
         70    > > FE_FETCH_R                                       ~35     $34, !5, ->77
         71    >   ASSIGN                                                   !6, ~35
   33    72        TYPE_CHECK                                    4          !5
         73      > JMPZ                                                     ~37, ->76
   34    74    >   ASSIGN_DIM                                               !4, !6
         75        OP_DATA                                                  !5
   32    76    > > JMP                                                      ->70
         77    >   FE_FREE                                                  $34
   38    78        COUNT                                            ~39     !4
         79        IS_SMALLER                                               0, ~39
         80      > JMPZ                                                     ~40, ->92
   39    81    >   INIT_FCALL                                               'join'
         82        SEND_VAL                                                 '%2C+'
         83        INIT_FCALL                                               'array_keys'
         84        SEND_VAR                                                 !4
         85        DO_ICALL                                         $41     
         86        SEND_VAR                                                 $41
         87        DO_ICALL                                         $42     
         88        CONCAT                                           ~43     'Failed%3A+', $42
         89        CONCAT                                           ~44     ~43, '%0A'
         90        ECHO                                                     ~44
   40    91      > EXIT                                                     1
   43    92    > > EXIT                                                     0
         93*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.82 ms | 1396 KiB | 37 Q