3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface TestInterface { public function foo(); } class Test implements TestInterface { public function foo(...$extraArgs) { $closureToCall = 'max'; //this function accepts multiple args $start = microtime(true); for ($i=0; $i<1e5; $i++) { } $end = microtime(true); echo "Took: ", ($end-$start)*1e3, " ms"; $start = microtime(true); for ($i=0; $i<1e5; $i++) { } $end = microtime(true); echo "Took: ", ($end-$start)*1e3, " ms"; } } $obj = new Test; $obj->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UDpBq
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'test'
   26     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   27     4        INIT_METHOD_CALL                                         !0, 'foo'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function foo

End of class TestInterface.

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 8
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 26
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 26
Branch analysis from position: 29
Branch analysis from position: 26
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 8
Branch analysis from position: 11
Branch analysis from position: 8
filename:       /in/UDpBq
function name:  foo
number of ops:  39
compiled vars:  !0 = $extraArgs, !1 = $closureToCall, !2 = $start, !3 = $i, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_VARIADIC                                    !0      
   10     1        ASSIGN                                                   !1, 'max'
   11     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   12     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->9
          8    >   PRE_INC                                                  !3
          9    >   IS_SMALLER                                               !3, 100000
         10      > JMPNZ                                                    ~10, ->8
   15    11    >   INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !4, $11
   16    15        ECHO                                                     'Took%3A+'
         16        SUB                                              ~13     !4, !2
         17        MUL                                              ~14     ~13, 1000
         18        ECHO                                                     ~14
         19        ECHO                                                     '+ms'
   17    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $15     
         23        ASSIGN                                                   !2, $15
   18    24        ASSIGN                                                   !3, 0
         25      > JMP                                                      ->27
         26    >   PRE_INC                                                  !3
         27    >   IS_SMALLER                                               !3, 100000
         28      > JMPNZ                                                    ~19, ->26
   21    29    >   INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $20     
         32        ASSIGN                                                   !4, $20
   22    33        ECHO                                                     'Took%3A+'
         34        SUB                                              ~22     !4, !2
         35        MUL                                              ~23     ~22, 1000
         36        ECHO                                                     ~23
         37        ECHO                                                     '+ms'
   23    38      > RETURN                                                   null

End of function foo

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.14 ms | 1400 KiB | 15 Q