3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = "Hello 🤖"; $chop = substr($test, 0, 8); //Doh! This will crash almost all multibyte aware functions... $json = json_encode($chop); var_dump(json_last_error_msg(), $json);
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/GtVmU
function name:  (null)
number of ops:  18
compiled vars:  !0 = $test, !1 = $chop, !2 = $json
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, 'Hello+%F0%9F%A4%96'
   4     1        INIT_FCALL                                               'substr'
         2        SEND_VAR                                                 !0
         3        SEND_VAL                                                 0
         4        SEND_VAL                                                 8
         5        DO_ICALL                                         $4      
         6        ASSIGN                                                   !1, $4
   5     7        INIT_FCALL                                               'json_encode'
         8        SEND_VAR                                                 !1
         9        DO_ICALL                                         $6      
        10        ASSIGN                                                   !2, $6
   7    11        INIT_FCALL                                               'var_dump'
        12        INIT_FCALL                                               'json_last_error_msg'
        13        DO_ICALL                                         $8      
        14        SEND_VAR                                                 $8
        15        SEND_VAR                                                 !2
        16        DO_ICALL                                                 
   8    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0