3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ConfigurationProvider { public function getConfig() : array; } final class ConfigurationProviderImplementing implements ConfigurationProvider { public function getConfig() : array { return []; } } $provider = new ConfigurationProviderNonImplementing(); var_dump(! $provider instanceof ConfigProviderInterface && ! is_callable([$provider, 'getConfig']));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/X4c7v
function name:  (null)
number of ops:  18
compiled vars:  !0 = $provider
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'configurationproviderimplementing'
   17     1        NEW                                              $1      'ConfigurationProviderNonImplementing'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   19     4        INIT_FCALL                                               'var_dump'
          5        INSTANCEOF                                       ~4      !0, 'ConfigProviderInterface'
          6        BOOL_NOT                                         ~5      ~4
          7      > JMPZ_EX                                          ~5      ~5, ->15
          8    >   INIT_FCALL                                               'is_callable'
          9        INIT_ARRAY                                       ~6      !0
         10        ADD_ARRAY_ELEMENT                                ~6      'getConfig'
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                         $7      
         13        BOOL_NOT                                         ~8      $7
         14        BOOL                                             ~5      ~8
         15    >   SEND_VAL                                                 ~5
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function getconfig

End of class ConfigurationProvider.

Class ConfigurationProviderImplementing:
Function getconfig:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X4c7v
function name:  getConfig
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   <array>
   13     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function getconfig

End of class ConfigurationProviderImplementing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.9 ms | 1396 KiB | 17 Q