3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'Dow Jones' => array(3, 10, 1, 5, 4, 15, 49, 14, 7, 2, 3), 'Direct US' => array(1, 2, 1, 2) ); $length = max(array_map('count', $array)); $array = array_map( function (array $a) use ($length) { return array_pad($a, $length, null); }, $array ); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvSfJ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'max'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'count'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    9     9        INIT_FCALL                                               'array_map'
   10    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQvSfJ%3A10%240'
         11        BIND_LEXICAL                                             ~6, !1
         12        SEND_VAL                                                 ~6
   11    13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
    9    15        ASSIGN                                                   !0, $7
   14    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQvSfJ%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvSfJ
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_pad'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 null
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
          8*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.61 ms | 1396 KiB | 21 Q