3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLengthOfMissingArray($arrayOfArrays) { if(! is_array($arrayOfArrays)) { return 0; } $values = array_map(function($array) { return count($array); }, $arrayOfArrays); if(count($values) == 0) { return 0; } for($i = min($values); $i <= max($values); $i++) { if($key = array_search($i, $values) === false) { return $i; } } return 0; } echo getLengthOfMissingArray([[35,37],[27,4,46,38],[29,37,45,31,33,33],[],[20,8,47,15,48,10,10],[24],[31,32,31,24,21]]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W4gU6
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'getlengthofmissingarray'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function getlengthofmissingarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 20
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 20
Branch analysis from position: 34
Branch analysis from position: 20
filename:       /in/W4gU6
function name:  getLengthOfMissingArray
number of ops:  36
compiled vars:  !0 = $arrayOfArrays, !1 = $values, !2 = $i, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                  128  ~4      !0
          2        BOOL_NOT                                         ~5      ~4
          3      > JMPZ                                                     ~5, ->5
    5     4    > > RETURN                                                   0
    8     5    >   INIT_FCALL                                               'array_map'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FW4gU6%3A8%240'
   10     7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
    8    10        ASSIGN                                                   !1, $7
   12    11        COUNT                                            ~9      !1
         12        IS_EQUAL                                                 ~9, 0
         13      > JMPZ                                                     ~10, ->15
   13    14    > > RETURN                                                   0
   16    15    >   INIT_FCALL                                               'min'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
         19      > JMP                                                      ->29
   17    20    >   INIT_FCALL                                               'array_search'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $13     
         24        TYPE_CHECK                                    4  ~14     $13
         25        ASSIGN                                           ~15     !3, ~14
         26      > JMPZ                                                     ~15, ->28
   18    27    > > RETURN                                                   !2
   16    28    >   PRE_INC                                                  !2
         29    >   INIT_FCALL                                               'max'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $17     
         32        IS_SMALLER_OR_EQUAL                                      !2, $17
         33      > JMPNZ                                                    ~18, ->20
   22    34    > > RETURN                                                   0
   23    35*     > RETURN                                                   null

End of function getlengthofmissingarray

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.68 ms | 1407 KiB | 22 Q