3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This should produce failures when using a version of libpcre older than 8.32 */ 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('&#xAC00;&#xAC01;&#x0BA8;', 'UTF-8', 'HTML-ENTITIES'); print "$test_string\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-8') === 3); $tests['string_match'] = (preg_match('/^\X\X\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 = 77) Position 1 = 43, Position 2 = 50
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 50
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 49
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 65
Branch analysis from position: 54
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 65
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 50
filename:       /in/pEihc
function name:  (null)
number of ops:  67
compiled vars:  !0 = $phpinfo, !1 = $tests, !2 = $test_string, !3 = $fails, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    7     3        INIT_FCALL                                               'ob_start'
          4        DO_ICALL                                                 
    8     5        INIT_FCALL                                               'phpinfo'
          6        DO_ICALL                                                 
    9     7        INIT_FCALL                                               'ob_get_clean'
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !0, $9
   10    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F.%2APCRE+Library+Version+%3D%3E+%28.%2A%3F%24%29.%2A%2Fsm'
         12        SEND_VAL                                                 '%241'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $11     
         15        CONCAT                                           ~12     $11, '%0A'
         16        ECHO                                                     ~12
   12    17        ASSIGN                                                   !1, <array>
   13    18        INIT_FCALL                                               'mb_convert_encoding'
         19        SEND_VAL                                                 '%26%23xAC00%3B%26%23xAC01%3B%26%23x0BA8%3B'
         20        SEND_VAL                                                 'UTF-8'
         21        SEND_VAL                                                 'HTML-ENTITIES'
         22        DO_ICALL                                         $14     
         23        ASSIGN                                                   !2, $14
   14    24        NOP                                                      
         25        FAST_CONCAT                                      ~16     !2, '%0A'
         26        ECHO                                                     ~16
   16    27        INIT_FCALL                                               'mb_strlen'
         28        SEND_VAR                                                 !2
         29        SEND_VAL                                                 'UTF-8'
         30        DO_ICALL                                         $18     
         31        IS_IDENTICAL                                     ~19     $18, 3
         32        ASSIGN_DIM                                               !1, 'string_length'
         33        OP_DATA                                                  ~19
   17    34        INIT_FCALL                                               'preg_match'
         35        SEND_VAL                                                 '%2F%5E%5CX%5CX%5CX%24%2Fu'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $21     
         38        IS_IDENTICAL                                     ~22     $21, 1
         39        ASSIGN_DIM                                               !1, 'string_match'
         40        OP_DATA                                                  ~22
   19    41        ASSIGN                                                   !3, <array>
   20    42      > FE_RESET_R                                       $24     !1, ->50
         43    > > FE_FETCH_R                                       ~25     $24, !4, ->50
         44    >   ASSIGN                                                   !5, ~25
   21    45        TYPE_CHECK                                    4          !4
         46      > JMPZ                                                     ~27, ->49
   22    47    >   ASSIGN_DIM                                               !3, !5
         48        OP_DATA                                                  !4
   20    49    > > JMP                                                      ->43
         50    >   FE_FREE                                                  $24
   26    51        COUNT                                            ~29     !3
         52        IS_SMALLER                                               0, ~29
         53      > JMPZ                                                     ~30, ->65
   27    54    >   INIT_FCALL                                               'join'
         55        SEND_VAL                                                 '%2C+'
         56        INIT_FCALL                                               'array_keys'
         57        SEND_VAR                                                 !3
         58        DO_ICALL                                         $31     
         59        SEND_VAR                                                 $31
         60        DO_ICALL                                         $32     
         61        CONCAT                                           ~33     'Failed%3A+', $32
         62        CONCAT                                           ~34     ~33, '%0A'
         63        ECHO                                                     ~34
   28    64      > EXIT                                                     1
   31    65    > > EXIT                                                     0
         66*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.9 ms | 1405 KiB | 33 Q