3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dostuff() { echo "mb_check_encoding:\n"; if ( function_exists( 'mb_check_encoding' ) ) { echo ' Surrogate: '; var_dump( mb_check_encoding( "\xED\xA0\x81\xED\xB0\x80", 'UTF-8' ) ); echo ' U+110000 : '; var_dump( mb_check_encoding( "\xF4\x90\x80\x80", 'UTF-8' ) ); echo ' U+FFFF : '; var_dump( mb_check_encoding( "\xEF\xBF\xBF", 'UTF-8' ) ); } else { echo "absent\n"; } echo "preg_match:\n"; if ( function_exists( 'preg_match' ) ) { echo ' Surrogate: '; var_dump(preg_match( '//u', "\xED\xA0\x81\xED\xB0\x80" ) ); echo ' U+110000 : '; var_dump(preg_match( '//u', "\xF4\x90\x80\x80" )); echo ' U+FFFF : '; var_dump(preg_match( '//u', "\xEF\xBF\xBF" )); } else { echo "absent\n"; } } dostuff();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5SfaK
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'dostuff'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function dostuff:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 30
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 61
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 61
Branch analysis from position: 36
Branch analysis from position: 61
filename:       /in/5SfaK
function name:  dostuff
number of ops:  63
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'mb_check_encoding%3A%0A'
    6     1        INIT_FCALL                                               'function_exists'
          2        SEND_VAL                                                 'mb_check_encoding'
          3        DO_ICALL                                         $0      
          4      > JMPZ                                                     $0, ->30
    7     5    >   ECHO                                                     '++Surrogate%3A+'
          6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'mb_check_encoding'
          8        SEND_VAL                                                 '%ED%A0%81%ED%B0%80'
          9        SEND_VAL                                                 'UTF-8'
         10        DO_ICALL                                         $1      
         11        SEND_VAR                                                 $1
         12        DO_ICALL                                                 
    8    13        ECHO                                                     '++U%2B110000+%3A+'
         14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'mb_check_encoding'
         16        SEND_VAL                                                 '%F4%90%80%80'
         17        SEND_VAL                                                 'UTF-8'
         18        DO_ICALL                                         $3      
         19        SEND_VAR                                                 $3
         20        DO_ICALL                                                 
    9    21        ECHO                                                     '++U%2BFFFF+++%3A+'
         22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'mb_check_encoding'
         24        SEND_VAL                                                 '%EF%BF%BF'
         25        SEND_VAL                                                 'UTF-8'
         26        DO_ICALL                                         $5      
         27        SEND_VAR                                                 $5
         28        DO_ICALL                                                 
         29      > JMP                                                      ->31
   11    30    >   ECHO                                                     'absent%0A'
   14    31    >   ECHO                                                     'preg_match%3A%0A'
   15    32        INIT_FCALL                                               'function_exists'
         33        SEND_VAL                                                 'preg_match'
         34        DO_ICALL                                         $7      
         35      > JMPZ                                                     $7, ->61
   16    36    >   ECHO                                                     '++Surrogate%3A+'
         37        INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'preg_match'
         39        SEND_VAL                                                 '%2F%2Fu'
         40        SEND_VAL                                                 '%ED%A0%81%ED%B0%80'
         41        DO_ICALL                                         $8      
         42        SEND_VAR                                                 $8
         43        DO_ICALL                                                 
   17    44        ECHO                                                     '++U%2B110000+%3A+'
         45        INIT_FCALL                                               'var_dump'
         46        INIT_FCALL                                               'preg_match'
         47        SEND_VAL                                                 '%2F%2Fu'
         48        SEND_VAL                                                 '%F4%90%80%80'
         49        DO_ICALL                                         $10     
         50        SEND_VAR                                                 $10
         51        DO_ICALL                                                 
   18    52        ECHO                                                     '++U%2BFFFF+++%3A+'
         53        INIT_FCALL                                               'var_dump'
         54        INIT_FCALL                                               'preg_match'
         55        SEND_VAL                                                 '%2F%2Fu'
         56        SEND_VAL                                                 '%EF%BF%BF'
         57        DO_ICALL                                         $12     
         58        SEND_VAR                                                 $12
         59        DO_ICALL                                                 
         60      > JMP                                                      ->62
   20    61    >   ECHO                                                     'absent%0A'
   23    62    > > RETURN                                                   null

End of function dostuff

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1402 KiB | 22 Q