3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fa () { return 1; } function fb () { return 1; } function fc () { return 1; } $calla = 'fa'; $callb = 'fb'; $callc = 'fc'; $time = microtime( true ); for( $i = 5000; $i--; ) { $x = 0; $x += $calla(); $x += $callb(); $x += $callc(); if( $x != 3 ) die( 'Bad numbers' ); } echo( "Variable functions took " . (microtime( true ) - $time) . " seconds.<br />" ); $time = microtime( true ); for( $i = 5000; $i--; ) { $x = 0; $x += call_user_func('fa', ''); $x += call_user_func('fb', ''); $x += call_user_func('fc', ''); if( $x != 3 ) die( 'Bad numbers' ); } echo( "call_user_func took " . (microtime( true ) - $time) . " seconds.<br />" ); $time = microtime( true ); for( $i = 5000; $i--; ) { $x = 0; eval( '$x += ' . $calla . '();' ); eval( '$x += ' . $callb . '();' ); eval( '$x += ' . $callc . '();' ); if( $x != 3 ) die( 'Bad numbers' ); } echo( "eval took " . (microtime( true ) - $time) . " seconds.<br />" ); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 9
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 37
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
2 jumps found. (Code = 44) Position 1 = 83, Position 2 = 68
Branch analysis from position: 83
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 80, Position 2 = 81
Branch analysis from position: 80
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 81
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 53
Branch analysis from position: 52
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 53
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 22
filename:       /in/3mWaW
function name:  (null)
number of ops:  91
compiled vars:  !0 = $calla, !1 = $callb, !2 = $callc, !3 = $time, !4 = $i, !5 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'fa'
    8     1        ASSIGN                                                   !1, 'fb'
    9     2        ASSIGN                                                   !2, 'fc'
   11     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !3, $9
   12     7        ASSIGN                                                   !4, 5000
          8      > JMP                                                      ->22
   13     9    >   ASSIGN                                                   !5, 0
   14    10        INIT_DYNAMIC_CALL                                        !0
         11        DO_FCALL                                      0  $13     
         12        ASSIGN_OP                                     1          !5, $13
   15    13        INIT_DYNAMIC_CALL                                        !1
         14        DO_FCALL                                      0  $15     
         15        ASSIGN_OP                                     1          !5, $15
   16    16        INIT_DYNAMIC_CALL                                        !2
         17        DO_FCALL                                      0  $17     
         18        ASSIGN_OP                                     1          !5, $17
   17    19        IS_NOT_EQUAL                                             !5, 3
         20      > JMPZ                                                     ~19, ->22
         21    > > EXIT                                                     'Bad+numbers'
   12    22    >   POST_DEC                                         ~20     !4
         23      > JMPNZ                                                    ~20, ->9
   19    24    >   INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $21     
         27        SUB                                              ~22     $21, !3
         28        CONCAT                                           ~23     'Variable+functions+took+', ~22
         29        CONCAT                                           ~24     ~23, '+seconds.%3Cbr+%2F%3E'
         30        ECHO                                                     ~24
   21    31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $25     
         34        ASSIGN                                                   !3, $25
   22    35        ASSIGN                                                   !4, 5000
         36      > JMP                                                      ->53
   23    37    >   ASSIGN                                                   !5, 0
   24    38        INIT_FCALL                                               'fa'
         39        SEND_USER                                                ''
         40        DO_FCALL                                      0  $29     
         41        ASSIGN_OP                                     1          !5, $29
   25    42        INIT_FCALL                                               'fb'
         43        SEND_USER                                                ''
         44        DO_FCALL                                      0  $31     
         45        ASSIGN_OP                                     1          !5, $31
   26    46        INIT_FCALL                                               'fc'
         47        SEND_USER                                                ''
         48        DO_FCALL                                      0  $33     
         49        ASSIGN_OP                                     1          !5, $33
   27    50        IS_NOT_EQUAL                                             !5, 3
         51      > JMPZ                                                     ~35, ->53
         52    > > EXIT                                                     'Bad+numbers'
   22    53    >   POST_DEC                                         ~36     !4
         54      > JMPNZ                                                    ~36, ->37
   29    55    >   INIT_FCALL                                               'microtime'
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $37     
         58        SUB                                              ~38     $37, !3
         59        CONCAT                                           ~39     'call_user_func+took+', ~38
         60        CONCAT                                           ~40     ~39, '+seconds.%3Cbr+%2F%3E'
         61        ECHO                                                     ~40
   31    62        INIT_FCALL                                               'microtime'
         63        SEND_VAL                                                 <true>
         64        DO_ICALL                                         $41     
         65        ASSIGN                                                   !3, $41
   32    66        ASSIGN                                                   !4, 5000
         67      > JMP                                                      ->81
   33    68    >   ASSIGN                                                   !5, 0
   34    69        CONCAT                                           ~45     '%24x+%2B%3D+', !0
         70        CONCAT                                           ~46     ~45, '%28%29%3B'
         71        INCLUDE_OR_EVAL                                          ~46, EVAL
   35    72        CONCAT                                           ~48     '%24x+%2B%3D+', !1
         73        CONCAT                                           ~49     ~48, '%28%29%3B'
         74        INCLUDE_OR_EVAL                                          ~49, EVAL
   36    75        CONCAT                                           ~51     '%24x+%2B%3D+', !2
         76        CONCAT                                           ~52     ~51, '%28%29%3B'
         77        INCLUDE_OR_EVAL                                          ~52, EVAL
   37    78        IS_NOT_EQUAL                                             !5, 3
         79      > JMPZ                                                     ~54, ->81
         80    > > EXIT                                                     'Bad+numbers'
   32    81    >   POST_DEC                                         ~55     !4
         82      > JMPNZ                                                    ~55, ->68
   39    83    >   INIT_FCALL                                               'microtime'
         84        SEND_VAL                                                 <true>
         85        DO_ICALL                                         $56     
         86        SUB                                              ~57     $56, !3
         87        CONCAT                                           ~58     'eval+took+', ~57
         88        CONCAT                                           ~59     ~58, '+seconds.%3Cbr+%2F%3E'
         89        ECHO                                                     ~59
   41    90      > RETURN                                                   1

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

End of function fa

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

End of function fb

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

End of function fc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.18 ms | 1407 KiB | 18 Q