3v4l.org

run code in 500+ PHP versions simultaneously
<?php // define( // 'FOO_CONSTANT', // array( // 'link' => array( ':hover', ':focus', ':active' ), // ) // ); // var_dump( array_key_exists( 'link', FOO_CONSTANT ) ); // var_dump( isset( FOO_CONSTANT['link'] ) ); class Foo { const VALID_ELEMENT_PSEUDO_SELECTORS = array( 'link' => array( ':hover', ':focus', ':active' ), ); } // Works.in >= PHP 5.6. var_dump( array_key_exists( 'link', FOO::VALID_ELEMENT_PSEUDO_SELECTORS ) ); var_dump( ! empty( FOO::VALID_ELEMENT_PSEUDO_SELECTORS['link'] ) ); // Doesn't work on < PHP 7.0. var_dump( isset( FOO::VALID_ELEMENT_PSEUDO_SELECTORS['link'] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lrFo3
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_CLASS_CONSTANT                                 ~0      'FOO', 'VALID_ELEMENT_PSEUDO_SELECTORS'
          2        ARRAY_KEY_EXISTS                                     ~1      'link', ~0
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                                     
   20     5        INIT_FCALL                                                   'var_dump'
          6        FETCH_CLASS_CONSTANT                                 ~3      'FOO', 'VALID_ELEMENT_PSEUDO_SELECTORS'
          7        ISSET_ISEMPTY_DIM_OBJ                             1  ~4      ~3, 'link'
          8        BOOL_NOT                                             ~5      ~4
          9        SEND_VAL                                                     ~5
         10        DO_ICALL                                                     
   23    11        INIT_FCALL                                                   'var_dump'
         12        FETCH_CLASS_CONSTANT                                 ~7      'FOO', 'VALID_ELEMENT_PSEUDO_SELECTORS'
         13        ISSET_ISEMPTY_DIM_OBJ                             0  ~8      ~7, 'link'
         14        SEND_VAL                                                     ~8
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
189.69 ms | 1495 KiB | 14 Q