3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = new ArrayIterator( array( 'foo' => 1, 'bar' => 2, ) ); $keys = array_keys( $x ); if ( ! empty( $keys ) && is_array( $keys ) ) { print "PASS"; } else { print "FAIL"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/bdoq5
function name:  (null)
number of ops:  18
compiled vars:  !0 = $x, !1 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'ArrayIterator'
    4     1        SEND_VAL_EX                                              <array>
    3     2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    7     4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    8     8        ISSET_ISEMPTY_CV                                 ~7      !1
          9        BOOL_NOT                                         ~8      ~7
         10      > JMPZ_EX                                          ~8      ~8, ->13
         11    >   TYPE_CHECK                                  128  ~9      !1
         12        BOOL                                             ~8      ~9
         13    > > JMPZ                                                     ~8, ->16
    9    14    >   ECHO                                                     'PASS'
    8    15      > JMP                                                      ->17
   11    16    >   ECHO                                                     'FAIL'
   12    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.06 ms | 987 KiB | 14 Q