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('&#xAC00;&#xAC01;&#x0BA8;&#x0BBF;', 'UTF-8', 'HTML-ENTITIES'); print "$test_string\n"; $tests['string_length'] = (mb_strlen($test_string, 'UTF-8') === 4); $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 = 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 = 53, Position 2 = 60
Branch analysis from position: 53
2 jumps found. (Code = 78) Position 1 = 54, Position 2 = 60
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 59
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 75
Branch analysis from position: 64
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 75
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 60
filename:       /in/aCiRA
function name:  (null)
number of ops:  77
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%23xAC00%3B%26%23xAC01%3B%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
   23    37        INIT_FCALL                                               'mb_strlen'
         38        SEND_VAR                                                 !2
         39        SEND_VAL                                                 'UTF-8'
         40        DO_ICALL                                         $21     
         41        IS_IDENTICAL                                     ~22     $21, 4
         42        ASSIGN_DIM                                               !1, 'string_length'
         43        OP_DATA                                                  ~22
   24    44        INIT_FCALL                                               'preg_match'
         45        SEND_VAL                                                 '%2F%5E%5CX%5CX%5CX%24%2Fu'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                         $24     
         48        IS_IDENTICAL                                     ~25     $24, 1
         49        ASSIGN_DIM                                               !1, 'string_match'
         50        OP_DATA                                                  ~25
   26    51        ASSIGN                                                   !3, <array>
   27    52      > FE_RESET_R                                       $27     !1, ->60
         53    > > FE_FETCH_R                                       ~28     $27, !4, ->60
         54    >   ASSIGN                                                   !5, ~28
   28    55        TYPE_CHECK                                    4          !4
         56      > JMPZ                                                     ~30, ->59
   29    57    >   ASSIGN_DIM                                               !3, !5
         58        OP_DATA                                                  !4
   27    59    > > JMP                                                      ->53
         60    >   FE_FREE                                                  $27
   33    61        COUNT                                            ~32     !3
         62        IS_SMALLER                                               0, ~32
         63      > JMPZ                                                     ~33, ->75
   34    64    >   INIT_FCALL                                               'join'
         65        SEND_VAL                                                 '%2C+'
         66        INIT_FCALL                                               'array_keys'
         67        SEND_VAR                                                 !3
         68        DO_ICALL                                         $34     
         69        SEND_VAR                                                 $34
         70        DO_ICALL                                         $35     
         71        CONCAT                                           ~36     'Failed%3A+', $35
         72        CONCAT                                           ~37     ~36, '%0A'
         73        ECHO                                                     ~37
   35    74      > EXIT                                                     1
   38    75    > > EXIT                                                     0
         76*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.04 ms | 1400 KiB | 35 Q