3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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"; 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
Jump found. Position 1 = -2
filename:       /in/iQCPa
function name:  (null)
number of ops:  78
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
  14    47        INIT_FCALL                                               'mb_internal_encoding'
        48        SEND_VAL                                                 'utf-8'
        49        DO_ICALL                                                 
  16    50        INIT_FCALL                                               'mb_substr'
        51        SEND_VAR                                                 !0
        52        SEND_VAL                                                 6
        53        DO_ICALL                                         $18     
        54        CONCAT                                           ~19     $18, '%0A'
        55        ECHO                                                     ~19
  18    56        INIT_FCALL                                               'mb_substr'
        57        SEND_VAR                                                 !0
        58        SEND_VAL                                                 6
        59        SEND_VAL                                                 4
        60        DO_ICALL                                         $20     
        61        CONCAT                                           ~21     $20, '%0A'
        62        ECHO                                                     ~21
  20    63        INIT_FCALL                                               'mb_substr'
        64        SEND_VAR                                                 !0
        65        SEND_VAL                                                 6
        66        SEND_VAL                                                 -4
        67        DO_ICALL                                         $22     
        68        CONCAT                                           ~23     $22, '%0A'
        69        ECHO                                                     ~23
  22    70        INIT_FCALL                                               'mb_substr'
        71        SEND_VAR                                                 !0
        72        SEND_VAL                                                 -4
        73        DO_ICALL                                         $24     
        74        CONCAT                                           ~25     $24, '%0A'
        75        ECHO                                                     ~25
  24    76      > EXIT                                                     0
        77*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0