3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (version_compare(PHP_VERSION, '5.5.0') < 0) { echo "not supported version"; die(); } $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
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ei5kQ
function name:  (null)
number of ops:  38
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                                               'version_compare'
          1        SEND_VAL                                                 '8.0.0'
          2        SEND_VAL                                                 '5.5.0'
          3        DO_ICALL                                         $5      
          4        IS_SMALLER                                               $5, 0
          5      > JMPZ                                                     ~6, ->8
    4     6    >   ECHO                                                     'not+supported+version'
    5     7      > EXIT                                                     
    8     8    >   INIT_FCALL                                               'unserialize'
          9        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'
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !0, $7
   10    12        INIT_FCALL                                               'array_column'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 'frage_id'
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !1, $9
   11    17        INIT_FCALL                                               'array_column'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'antwort'
         20        DO_ICALL                                         $11     
         21        ASSIGN                                                   !2, $11
   13    22        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fei5kQ%3A13%240'
         23        ASSIGN                                                   !3, ~13
   15    24        INIT_FCALL                                               'array_map'
         25        SEND_VAR                                                 !3
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $15     
         28        ASSIGN                                                   !1, $15
   16    29        INIT_FCALL                                               'array_combine'
         30        SEND_VAR                                                 !1
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $17     
         33        ASSIGN                                                   !4, $17
   18    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !4
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fei5kQ%3A13%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.59 ms | 1400 KiB | 25 Q