3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "manufacturer" => "BB", "width" => "245, 225", "height" => "45, 65", "diameter" => "19, 17", "type" => "AA", ]; $mandatoryFields = [ 'width', 'height', 'diameter', ]; var_export( array_map( null, ...array_values( array_map( fn($v) => explode(', ', $v), array_intersect_key( $arr, array_flip($mandatoryFields) ) ) ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dEspj
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $mandatoryFields
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   17     2        INIT_FCALL                                               'var_export'
   18     3        INIT_FCALL                                               'array_map'
   19     4        SEND_VAL                                                 null
   20     5        INIT_FCALL                                               'array_values'
   21     6        INIT_FCALL                                               'array_map'
   22     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdEspj%3A22%240'
          8        SEND_VAL                                                 ~4
   23     9        INIT_FCALL                                               'array_intersect_key'
   24    10        SEND_VAR                                                 !0
   25    11        INIT_FCALL                                               'array_flip'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                         $7      
         18        SEND_VAR                                                 $7
         19        DO_ICALL                                         $8      
         20        SEND_UNPACK                                              $8
         21        CHECK_UNDEF_ARGS                                         
         22        DO_ICALL                                         $9      
         23        SEND_VAR                                                 $9
         24        DO_ICALL                                                 
   30    25      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FdEspj%3A22%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dEspj
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdEspj%3A22%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.42 ms | 1396 KiB | 25 Q