3v4l.org

run code in 500+ PHP versions simultaneously
<?php $payloads = [ 'a' => [null, null, null, null, null], 'b' => [null, null, 1, null, null] ]; foreach ($payloads as $key => $payload) { printf( "%s: %s, %s, %s\n", $key, var_export( array_reduce( $payload, function ($acc, $value) { return $acc && $value === null; }, true ), true ), var_export( !array_filter( $payload, function ($value) { return $value !== null; } ), true ), var_export( $payload === array_filter($payload, 'is_null'), true ) ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 41
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 41
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/SJNnY
function name:  (null)
number of ops:  43
compiled vars:  !0 = $payloads, !1 = $payload, !2 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    8     1      > FE_RESET_R                                           $4      !0, ->41
          2    > > FE_FETCH_R                                           ~5      $4, !1, ->41
          3    >   ASSIGN                                                       !2, ~5
    9     4        INIT_FCALL                                                   'printf'
   10     5        SEND_VAL                                                     '%25s%3A+%25s%2C+%25s%2C+%25s%0A'
   11     6        SEND_VAR                                                     !2
   12     7        INIT_FCALL                                                   'var_export'
   13     8        INIT_FCALL                                                   'array_reduce'
   14     9        SEND_VAR                                                     !1
   15    10        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
   17    11        SEND_VAL                                                     ~7
   18    12        SEND_VAL                                                     <true>
   13    13        DO_ICALL                                             $8      
   18    14        SEND_VAR                                                     $8
   20    15        SEND_VAL                                                     <true>
   12    16        DO_ICALL                                             $9      
   20    17        SEND_VAR                                                     $9
   22    18        INIT_FCALL                                                   'var_export'
   23    19        INIT_FCALL                                                   'array_filter'
   24    20        SEND_VAR                                                     !1
   25    21        DECLARE_LAMBDA_FUNCTION                              ~10     [1]
   27    22        SEND_VAL                                                     ~10
   23    23        DO_ICALL                                             $11     
   27    24        BOOL_NOT                                             ~12     $11
         25        SEND_VAL                                                     ~12
   29    26        SEND_VAL                                                     <true>
   22    27        DO_ICALL                                             $13     
   29    28        SEND_VAR                                                     $13
   31    29        INIT_FCALL                                                   'var_export'
   32    30        INIT_FCALL                                                   'array_filter'
         31        SEND_VAR                                                     !1
         32        SEND_VAL                                                     'is_null'
         33        DO_ICALL                                             $14     
         34        IS_IDENTICAL                                         ~15     !1, $14
         35        SEND_VAL                                                     ~15
   33    36        SEND_VAL                                                     <true>
   31    37        DO_ICALL                                             $16     
   33    38        SEND_VAR                                                     $16
    9    39        DO_ICALL                                                     
    8    40      > JMP                                                          ->2
         41    >   FE_FREE                                                      $4
   36    42      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/SJNnY
function name:  {closure:/in/SJNnY:15}
number of ops:  7
compiled vars:  !0 = $acc, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   16     2      > JMPZ_EX                                              ~2      !0, ->5
          3    >   TYPE_CHECK                                        2  ~3      !1
          4        BOOL                                                 ~2      ~3
          5    > > RETURN                                                       ~2
   17     6*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SJNnY
function name:  {closure:/in/SJNnY:25}
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   RECV                                                 !0      
   26     1        TYPE_CHECK                                      1020  ~1      !0
          2      > RETURN                                                       ~1
   27     3*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.66 ms | 2036 KiB | 17 Q