3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = 0; echo (int) !$num; //method 1 echo array(1,0)[$num]; //method 2 echo (int) ($num < 1); //method 3 echo (int)empty($num); //method 4
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XVpHJ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    5     1        BOOL_NOT                                         ~2      !0
          2        CAST                                          4  ~3      ~2
          3        ECHO                                                     ~3
    6     4        FETCH_DIM_R                                      ~4      <array>, !0
          5        ECHO                                                     ~4
    7     6        IS_SMALLER                                       ~5      !0, 1
          7        CAST                                          4  ~6      ~5
          8        ECHO                                                     ~6
    8     9        ISSET_ISEMPTY_CV                                 ~7      !0
         10        CAST                                          4  ~8      ~7
         11        ECHO                                                     ~8
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
218.86 ms | 995 KiB | 13 Q