3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller { function foo() { echo phpversion(); } } $controller = new Controller(); if (version_compare(phpversion(), '7', '>=')) { $callable = call_user_func_array(array($controller, 'self::foo'), []); } else { $callable = [$controller, 'foo']; } $callable();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/22PmS
function name:  (null)
number of ops:  25
compiled vars:  !0 = $controller, !1 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'Controller'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   11     3        INIT_FCALL                                               'version_compare'
          4        INIT_FCALL                                               'phpversion'
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        SEND_VAL                                                 '7'
          8        SEND_VAL                                                 '%3E%3D'
          9        DO_ICALL                                         $6      
         10      > JMPZ                                                     $6, ->19
   12    11    >   INIT_ARRAY                                       ~7      !0
         12        ADD_ARRAY_ELEMENT                                ~7      'self%3A%3Afoo'
         13        INIT_USER_CALL                                0          'call_user_func_array', ~7
         14        SEND_ARRAY                                               <array>
         15        CHECK_UNDEF_ARGS                                         
         16        DO_FCALL                                      0  $8      
         17        ASSIGN                                                   !1, $8
         18      > JMP                                                      ->22
   14    19    >   INIT_ARRAY                                       ~10     !0
         20        ADD_ARRAY_ELEMENT                                ~10     'foo'
         21        ASSIGN                                                   !1, ~10
   17    22    >   INIT_DYNAMIC_CALL                                        !1
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

Class Controller:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/22PmS
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'phpversion'
          1        DO_ICALL                                         $0      
          2        ECHO                                                     $0
    7     3      > RETURN                                                   null

End of function foo

End of class Controller.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.09 ms | 1396 KiB | 17 Q