3v4l.org

run code in 300+ PHP versions simultaneously
<?php function atLeastTwoNotNull() { return count(array_filter(func_get_args(), function($arg) { return !is_null($arg); } )) >= 2; } $a = null; $b = true; $c = false; $d = null; $e = null; var_dump(atLeastTwoNotNull($a, $b, $c, $d, $e));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ui33q
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, null
    7     1        ASSIGN                                                   !1, <true>
    8     2        ASSIGN                                                   !2, <false>
    9     3        ASSIGN                                                   !3, null
   10     4        ASSIGN                                                   !4, null
   12     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'atleasttwonotnull'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !3
         11        SEND_VAR                                                 !4
         12        DO_FCALL                                      0  $10     
         13        SEND_VAR                                                 $10
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function atleasttwonotnull:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ui33q
function name:  atLeastTwoNotNull
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_filter'
          1        FUNC_GET_ARGS                                    ~0      
          2        SEND_VAL                                                 ~0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fui33q%3A3%240'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        COUNT                                            ~3      $2
          7        IS_SMALLER_OR_EQUAL                              ~4      2, ~3
          8      > RETURN                                                   ~4
    4     9*     > RETURN                                                   null

End of function atleasttwonotnull

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

End of function %00%7Bclosure%7D%2Fin%2Fui33q%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.07 ms | 1399 KiB | 18 Q