3v4l.org

run code in 300+ PHP versions simultaneously
<?php $index_norm = array("key1" => "foobar", "key2" => "bananaramam", "key3" => "spam"); $result = array( "ids"=>array_keys($index_norm), "weights"=>array_values($index_norm) ); echo json_encode($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CS7tp
function name:  (null)
number of ops:  15
compiled vars:  !0 = $index_norm, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        INIT_ARRAY                                       ~4      $3, 'ids'
    6     5        INIT_FCALL                                               'array_values'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        ADD_ARRAY_ELEMENT                                ~4      $5, 'weights'
    4     9        ASSIGN                                                   !1, ~4
    9    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        ECHO                                                     $7
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.26 ms | 1394 KiB | 19 Q