3v4l.org

run code in 300+ PHP versions simultaneously
<?php function atLeastTwoNotNull() { return (count(array_filter(func_get_args(), 'is_null' )) < 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/dFQLV
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/dFQLV
function name:  atLeastTwoNotNull
number of ops:  9
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        SEND_VAL                                                 'is_null'
          4        DO_ICALL                                         $1      
          5        COUNT                                            ~2      $1
          6        IS_SMALLER                                       ~3      ~2, 2
          7      > RETURN                                                   ~3
    4     8*     > RETURN                                                   null

End of function atleasttwonotnull

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.69 ms | 1398 KiB | 18 Q