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($controller, 'foo'); } else { $callable = [$controller, 'foo']; } $callable();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpQmL
function name:  (null)
number of ops:  22
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, ->16
   12    11    >   INIT_USER_CALL                                1          'call_user_func', !0
         12        SEND_USER                                                'foo'
         13        DO_FCALL                                      0  $7      
         14        ASSIGN                                                   !1, $7
         15      > JMP                                                      ->19
   14    16    >   INIT_ARRAY                                       ~9      !0
         17        ADD_ARRAY_ELEMENT                                ~9      'foo'
         18        ASSIGN                                                   !1, ~9
   17    19    >   INIT_DYNAMIC_CALL                                        !1
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

Class Controller:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpQmL
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.7 ms | 1388 KiB | 17 Q