3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected static $array = ['a', 'b', 'c']; protected static function getArray() { return $array; } public static function test($testArray) { return array_key_intersect($testArray, array_flip(self::getArray())); } } print_r(Test::test(['a' => 2]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eVFdc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_STATIC_METHOD_CALL                                  'Test', 'test'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

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

End of function getarray

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eVFdc
function name:  test
number of ops:  12
compiled vars:  !0 = $testArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL_BY_NAME                                       'array_key_intersect'
          2        SEND_VAR_EX                                              !0
          3        INIT_FCALL                                               'array_flip'
          4        INIT_STATIC_METHOD_CALL                                  'getArray'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        SEND_VAR_NO_REF_EX                                       $2
          9        DO_FCALL                                      0  $3      
         10      > RETURN                                                   $3
   11    11*     > RETURN                                                   null

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.34 ms | 1395 KiB | 17 Q