3v4l.org

run code in 300+ PHP versions simultaneously
<?php function atLeastTwoNotNull() { var_dump(count(array_filter(func_get_args(), 'is_null'))); 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/vY05d
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
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, null
    8     1        ASSIGN                                                   !1, <true>
    9     2        ASSIGN                                                   !2, <false>
   10     3        ASSIGN                                                   !3, null
   11     4        ASSIGN                                                   !4, null
   13     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/vY05d
function name:  atLeastTwoNotNull
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'array_filter'
          2        FUNC_GET_ARGS                                    ~0      
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 'is_null'
          5        DO_ICALL                                         $1      
          6        COUNT                                            ~2      $1
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                                 
    4     9        INIT_FCALL                                               'array_filter'
         10        FUNC_GET_ARGS                                    ~4      
         11        SEND_VAL                                                 ~4
         12        SEND_VAL                                                 'is_null'
         13        DO_ICALL                                         $5      
         14        COUNT                                            ~6      $5
         15        IS_SMALLER_OR_EQUAL                              ~7      ~6, 2
         16      > RETURN                                                   ~7
    5    17*     > RETURN                                                   null

End of function atleasttwonotnull

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.44 ms | 944 KiB | 19 Q