3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $data = array ( 'tram B' => array ( 0 => array ( 'name' => 'Ile Verte' , 'distance' => 298, 'stationID' => 762, ), 1 => array ( 'name' => 'La Tronche Hôpital' , 'distance' => 425, 'stationID' => 771, ), ), 16 => array ( 0 => array ( 'name' => 'Bastille', 'distance' => 531, 'stationID' => 397 ), 1 => array ( 'name' => 'Xavier Jouvin', 'distance' => 589, 'stationID' => 438, ), ), ); $data['tram B'][1]['name'] = iconv('UTF8', 'ISO-8859-1', $data['tram B'][1]['name']); var_dump( mb_detect_order(), mb_detect_encoding($data['tram B'][1]['name']), mb_detect_encoding($data['tram B'][1]['name'], array('ISO-8859-1', 'UTF-8')), json_encode($data) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i7WEC
function name:  (null)
number of ops:  42
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, <array>
   37     4        INIT_FCALL_BY_NAME                                       'iconv'
          5        SEND_VAL_EX                                              'UTF8'
          6        SEND_VAL_EX                                              'ISO-8859-1'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_DIM_FUNC_ARG                               $6      !0, 'tram+B'
          9        FETCH_DIM_FUNC_ARG                               $7      $6, 1
         10        FETCH_DIM_FUNC_ARG                               $8      $7, 'name'
         11        SEND_FUNC_ARG                                            $8
         12        DO_FCALL                                      0  $9      
         13        FETCH_DIM_W                                      $3      !0, 'tram+B'
         14        FETCH_DIM_W                                      $4      $3, 1
         15        ASSIGN_DIM                                               $4, 'name'
         16        OP_DATA                                                  $9
   39    17        INIT_FCALL                                               'var_dump'
   40    18        INIT_FCALL                                               'mb_detect_order'
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
   41    21        INIT_FCALL                                               'mb_detect_encoding'
         22        FETCH_DIM_R                                      ~11     !0, 'tram+B'
         23        FETCH_DIM_R                                      ~12     ~11, 1
         24        FETCH_DIM_R                                      ~13     ~12, 'name'
         25        SEND_VAL                                                 ~13
         26        DO_ICALL                                         $14     
         27        SEND_VAR                                                 $14
   42    28        INIT_FCALL                                               'mb_detect_encoding'
         29        FETCH_DIM_R                                      ~15     !0, 'tram+B'
         30        FETCH_DIM_R                                      ~16     ~15, 1
         31        FETCH_DIM_R                                      ~17     ~16, 'name'
         32        SEND_VAL                                                 ~17
         33        SEND_VAL                                                 <array>
         34        DO_ICALL                                         $18     
         35        SEND_VAR                                                 $18
   43    36        INIT_FCALL                                               'json_encode'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                         $19     
         39        SEND_VAR                                                 $19
   39    40        DO_ICALL                                                 
   44    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.37 ms | 1465 KiB | 18 Q