3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static function bar($x,$y){ return $x*$y; } public static function met1(){ $met = $bar; //return static:: } } $s = microtime(true); for($x = 0; $x < 10000; $x++ ){ $a = is_callable(array('foo', 'bar')); } echo round(microtime(true) - $s,5)."\n"; $s = microtime(true); for($x = 0; $x < 10000; $x++ ){ $a = method_exists('foo', 'bar'); } echo round(microtime(true) - $s,5)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 29
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 29
Branch analysis from position: 37
Branch analysis from position: 29
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
Branch analysis from position: 6
filename:       /in/ZurLn
function name:  (null)
number of ops:  48
compiled vars:  !0 = $s, !1 = $x, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
   15     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->11
   16     6    >   INIT_FCALL                                               'is_callable'
          7        SEND_VAL                                                 <array>
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   15    10        PRE_INC                                                  !1
         11    >   IS_SMALLER                                               !1, 10000
         12      > JMPNZ                                                    ~9, ->6
   18    13    >   INIT_FCALL                                               'round'
         14        INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $10     
         17        SUB                                              ~11     $10, !0
         18        SEND_VAL                                                 ~11
         19        SEND_VAL                                                 5
         20        DO_ICALL                                         $12     
         21        CONCAT                                           ~13     $12, '%0A'
         22        ECHO                                                     ~13
   22    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !0, $14
   23    27        ASSIGN                                                   !1, 0
         28      > JMP                                                      ->35
   24    29    >   INIT_FCALL                                               'method_exists'
         30        SEND_VAL                                                 'foo'
         31        SEND_VAL                                                 'bar'
         32        DO_ICALL                                         $17     
         33        ASSIGN                                                   !2, $17
   23    34        PRE_INC                                                  !1
         35    >   IS_SMALLER                                               !1, 10000
         36      > JMPNZ                                                    ~20, ->29
   26    37    >   INIT_FCALL                                               'round'
         38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $21     
         41        SUB                                              ~22     $21, !0
         42        SEND_VAL                                                 ~22
         43        SEND_VAL                                                 5
         44        DO_ICALL                                         $23     
         45        CONCAT                                           ~24     $23, '%0A'
         46        ECHO                                                     ~24
         47      > RETURN                                                   1

Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZurLn
function name:  bar
number of ops:  5
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        MUL                                              ~2      !0, !1
          3      > RETURN                                                   ~2
    6     4*     > RETURN                                                   null

End of function bar

Function met1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZurLn
function name:  met1
number of ops:  2
compiled vars:  !0 = $met, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, !1
   11     1      > RETURN                                                   null

End of function met1

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.99 ms | 1400 KiB | 21 Q