3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = unserialize('a:3:{i:0;a:2:{s:8:"frage_id";s:1:"3";s:7:"antwort";s:1:"3";}i:1;a:2:{s:8:"frage_id";s:1:"4";s:7:"antwort";s:1:"3";}i:2;a:2:{s:8:"frage_id";s:1:"5";s:7:"antwort";s:1:"3";}}'); $keys = array_column($array, "frage_id"); $values = array_column($array, "antwort"); $prepend_func = function($value) { return "s" . $value; }; $keys = array_map($prepend_func, $keys); $combined = array_combine($keys, $values); print_r($combined);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kHtsn
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array, !1 = $keys, !2 = $values, !3 = $prepend_func, !4 = $combined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'unserialize'
          1        SEND_VAL                                                 'a%3A3%3A%7Bi%3A0%3Ba%3A2%3A%7Bs%3A8%3A%22frage_id%22%3Bs%3A1%3A%223%22%3Bs%3A7%3A%22antwort%22%3Bs%3A1%3A%223%22%3B%7Di%3A1%3Ba%3A2%3A%7Bs%3A8%3A%22frage_id%22%3Bs%3A1%3A%224%22%3Bs%3A7%3A%22antwort%22%3Bs%3A1%3A%223%22%3B%7Di%3A2%3Ba%3A2%3A%7Bs%3A8%3A%22frage_id%22%3Bs%3A1%3A%225%22%3Bs%3A7%3A%22antwort%22%3Bs%3A1%3A%223%22%3B%7D%7D'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        INIT_FCALL                                               'array_column'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'frage_id'
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !1, $7
    6     9        INIT_FCALL                                               'array_column'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'antwort'
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
    8    14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkHtsn%3A8%240'
         15        ASSIGN                                                   !3, ~11
   10    16        INIT_FCALL                                               'array_map'
         17        SEND_VAR                                                 !3
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !1, $13
   11    21        INIT_FCALL                                               'array_combine'
         22        SEND_VAR                                                 !1
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $15     
         25        ASSIGN                                                   !4, $15
   13    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FkHtsn%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kHtsn
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        CONCAT                                           ~1      's', !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FkHtsn%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1388 KiB | 23 Q