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";}}'); $array = array(); $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/KhifB
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array, !1 = $keys, !2 = $values, !3 = $prepend_func, !4 = $combined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'array_column'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'frage_id'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    8     6        INIT_FCALL                                               'array_column'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'antwort'
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   10    11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKhifB%3A10%240'
         12        ASSIGN                                                   !3, ~10
   12    13        INIT_FCALL                                               'array_map'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !1, $12
   13    18        INIT_FCALL                                               'array_combine'
         19        SEND_VAR                                                 !1
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $14     
         22        ASSIGN                                                   !4, $14
   15    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FKhifB%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.22 ms | 1396 KiB | 21 Q