3v4l.org

run code in 300+ PHP versions simultaneously
<?php $requirements = new class { public function minimum_php_version( float $version ): self { if ( version_compare( phpversion(), $version, '<' ) ) { throw new Exception( sprintf( "You need PHP version %s to run this plugin.", $version ) ); } return $this; } public function require_plugins(array $plugins): self { // Logic return $this; } }; try { $requirements ->minimum_php_version(8.0) ->require_plugins( ['bar.php', 'baz/baz.php'] ); } catch ( Exception $e ) { var_dump( $e->getMessage() ); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgEJC
function name:  (null)
number of ops:  18
compiled vars:  !0 = $requirements, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <true>  
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   20     4        INIT_METHOD_CALL                                         !0, 'minimum_php_version'
          5        SEND_VAL_EX                                              8
          6        DO_FCALL                                      0  $6      
   21     7        INIT_METHOD_CALL                                         $6, 'require_plugins'
          8        SEND_VAL_EX                                              <array>
          9        DO_FCALL                                      0          
         10      > JMP                                                      ->17
   22    11  E > > CATCH                                       last         'Exception'
   23    12    >   INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !1, 'getMessage'
         14        DO_FCALL                                      0  $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                                 
   24    17    > > RETURN                                                   1

Class class@anonymous:
Function minimum_php_version:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgEJC
function name:  minimum_php_version
number of ops:  22
compiled vars:  !0 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'version_compare'
          2        INIT_FCALL                                               'phpversion'
          3        DO_ICALL                                         $1      
          4        SEND_VAR                                                 $1
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '%3C'
          7        DO_ICALL                                         $2      
          8      > JMPZ                                                     $2, ->17
    6     9    >   NEW                                              $3      'Exception'
         10        INIT_FCALL                                               'sprintf'
         11        SEND_VAL                                                 'You+need+PHP+version+%25s+to+run+this+plugin.'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $4      
         14        SEND_VAR_NO_REF_EX                                       $4
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $3
    9    17    >   FETCH_THIS                                       ~6      
         18        VERIFY_RETURN_TYPE                                       ~6
         19      > RETURN                                                   ~6
   10    20*       VERIFY_RETURN_TYPE                                       
         21*     > RETURN                                                   null

End of function minimum_php_version

Function require_plugins:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgEJC
function name:  require_plugins
number of ops:  6
compiled vars:  !0 = $plugins
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        FETCH_THIS                                       ~1      
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   15     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function require_plugins

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.46 ms | 1024 KiB | 17 Q