3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array(); $arr2 = array(1,2); if (count($arr1)) { echo 'failure'; } if (count($arr2)) { echo 'success'; } if (count($arr1)) { echo 'hard fail'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 8
Branch analysis from position: 5
filename:       /in/5SPVZ
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        COUNT                                            ~4      !0
          3      > JMPZ                                                     ~4, ->5
    6     4    >   ECHO                                                     'failure'
    8     5    >   COUNT                                            ~5      !1
          6      > JMPZ                                                     ~5, ->8
    9     7    >   ECHO                                                     'success'
   11     8    >   COUNT                                            ~6      !0
          9      > JMPZ                                                     ~6, ->11
   12    10    >   ECHO                                                     'hard+fail'
   13    11    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.58 ms | 1397 KiB | 13 Q