3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'goofe eas تان ک'.chr( bindec( '11111100' ) ).'ے عسکری ذرائع کے مطابق بدھ' .chr( bindec( '11011111' ) ); echo mb_substr( $string , 6 , null , 'utf-8' )."\n"; echo mb_substr( $string , 6 , 4 , 'utf-8' )."\n"; echo mb_substr( $string , 6 , -4 )."\n"; echo mb_substr( $string , -4 , null , 'utf-8' )."\n"; echo "After setting internal encoding\n"; mb_internal_encoding( 'utf-8' ); echo mb_substr( $string , 6 )."\n"; echo mb_substr( $string , 6 , 4 )."\n"; echo mb_substr( $string , 6 , -4 )."\n"; echo mb_substr( $string , -4 )."\n"; exit(0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/fnMmd
function name:  (null)
number of ops:  79
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'chr'
          1        INIT_FCALL                                               'bindec'
          2        SEND_VAL                                                 '11111100'
          3        DO_ICALL                                         $1      
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      'goofe+eas+%D8%AA%D8%A7%D9%86+%DA%A9', $2
          7        CONCAT                                           ~4      ~3, '%DB%92+%D8%B9%D8%B3%DA%A9%D8%B1%DB%8C+%D8%B0%D8%B1%D8%A7%D8%A6%D8%B9+%DA%A9%DB%92+%D9%85%D8%B7%D8%A7%D8%A8%D9%82+%D8%A8%D8%AF%DA%BE'
          8        INIT_FCALL                                               'chr'
          9        INIT_FCALL                                               'bindec'
         10        SEND_VAL                                                 '11011111'
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                         $6      
         14        CONCAT                                           ~7      ~4, $6
         15        ASSIGN                                                   !0, ~7
    5    16        INIT_FCALL                                               'mb_substr'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 6
         19        SEND_VAL                                                 null
         20        SEND_VAL                                                 'utf-8'
         21        DO_ICALL                                         $9      
         22        CONCAT                                           ~10     $9, '%0A'
         23        ECHO                                                     ~10
    7    24        INIT_FCALL                                               'mb_substr'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 6
         27        SEND_VAL                                                 4
         28        SEND_VAL                                                 'utf-8'
         29        DO_ICALL                                         $11     
         30        CONCAT                                           ~12     $11, '%0A'
         31        ECHO                                                     ~12
    9    32        INIT_FCALL                                               'mb_substr'
         33        SEND_VAR                                                 !0
         34        SEND_VAL                                                 6
         35        SEND_VAL                                                 -4
         36        DO_ICALL                                         $13     
         37        CONCAT                                           ~14     $13, '%0A'
         38        ECHO                                                     ~14
   11    39        INIT_FCALL                                               'mb_substr'
         40        SEND_VAR                                                 !0
         41        SEND_VAL                                                 -4
         42        SEND_VAL                                                 null
         43        SEND_VAL                                                 'utf-8'
         44        DO_ICALL                                         $15     
         45        CONCAT                                           ~16     $15, '%0A'
         46        ECHO                                                     ~16
   13    47        ECHO                                                     'After+setting+internal+encoding%0A'
   15    48        INIT_FCALL                                               'mb_internal_encoding'
         49        SEND_VAL                                                 'utf-8'
         50        DO_ICALL                                                 
   17    51        INIT_FCALL                                               'mb_substr'
         52        SEND_VAR                                                 !0
         53        SEND_VAL                                                 6
         54        DO_ICALL                                         $18     
         55        CONCAT                                           ~19     $18, '%0A'
         56        ECHO                                                     ~19
   19    57        INIT_FCALL                                               'mb_substr'
         58        SEND_VAR                                                 !0
         59        SEND_VAL                                                 6
         60        SEND_VAL                                                 4
         61        DO_ICALL                                         $20     
         62        CONCAT                                           ~21     $20, '%0A'
         63        ECHO                                                     ~21
   21    64        INIT_FCALL                                               'mb_substr'
         65        SEND_VAR                                                 !0
         66        SEND_VAL                                                 6
         67        SEND_VAL                                                 -4
         68        DO_ICALL                                         $22     
         69        CONCAT                                           ~23     $22, '%0A'
         70        ECHO                                                     ~23
   23    71        INIT_FCALL                                               'mb_substr'
         72        SEND_VAR                                                 !0
         73        SEND_VAL                                                 -4
         74        DO_ICALL                                         $24     
         75        CONCAT                                           ~25     $24, '%0A'
         76        ECHO                                                     ~25
   25    77      > EXIT                                                     0
         78*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.69 ms | 1405 KiB | 21 Q