3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tests { const ELEMENTS = []; public function __construct() {} public static function test( $element ) { if ( empty( static::ELEMENTS[ $element ] ) ) { return false; } return true; } } var_dump( Tests::test( 'example' ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vqKpS
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Tests', 'test'
          2        SEND_VAL                                                 'example'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class Tests:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vqKpS
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vqKpS
function name:  test
number of ops:  7
compiled vars:  !0 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        FETCH_CLASS_CONSTANT                             ~1      'ELEMENTS'
          2        ISSET_ISEMPTY_DIM_OBJ                         1          ~1, !0
          3      > JMPZ                                                     ~2, ->5
   10     4    > > RETURN                                                   <false>
   13     5    > > RETURN                                                   <true>
   14     6*     > RETURN                                                   null

End of function test

End of class Tests.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.19 ms | 1426 KiB | 14 Q