3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(json_encode(array("foo" => utf8_encode('è'), "bar" => "bar")), json_last_error() === JSON_ERROR_UTF8); var_dump(json_encode(array("foo" => utf8_encode('è'), "bar" => "bar"), JSON_PARTIAL_OUTPUT_ON_ERROR)); var_dump(json_encode(array("foo" => utf8_encode('è'), "bar" => "bar")));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIGJD
function name:  (null)
number of ops:  39
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'json_encode'
          2        INIT_FCALL                                               'utf8_encode'
          3        SEND_VAL                                                 '%C3%A8'
          4        DO_ICALL                                         $0      
          5        INIT_ARRAY                                       ~1      $0, 'foo'
          6        ADD_ARRAY_ELEMENT                                ~1      'bar', 'bar'
          7        SEND_VAL                                                 ~1
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        INIT_FCALL                                               'json_last_error'
         11        DO_ICALL                                         $3      
         12        IS_IDENTICAL                                     ~4      $3, 5
         13        SEND_VAL                                                 ~4
         14        DO_ICALL                                                 
    4    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'json_encode'
         17        INIT_FCALL                                               'utf8_encode'
         18        SEND_VAL                                                 '%C3%A8'
         19        DO_ICALL                                         $6      
         20        INIT_ARRAY                                       ~7      $6, 'foo'
         21        ADD_ARRAY_ELEMENT                                ~7      'bar', 'bar'
         22        SEND_VAL                                                 ~7
         23        SEND_VAL                                                 512
         24        DO_ICALL                                         $8      
         25        SEND_VAR                                                 $8
         26        DO_ICALL                                                 
    5    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'json_encode'
         29        INIT_FCALL                                               'utf8_encode'
         30        SEND_VAL                                                 '%C3%A8'
         31        DO_ICALL                                         $10     
         32        INIT_ARRAY                                       ~11     $10, 'foo'
         33        ADD_ARRAY_ELEMENT                                ~11     'bar', 'bar'
         34        SEND_VAL                                                 ~11
         35        DO_ICALL                                         $12     
         36        SEND_VAR                                                 $12
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.12 ms | 1396 KiB | 21 Q