3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeObj { public function doTest() {} } $someObj = new SomeObj; class SomeClass { public static function doTest() {;} } // bench static method $starttime = microtime(true); for ($i = 0; $i< 100000; $i++) SomeClass::doTest($i); echo "Static Time: " , (microtime(true)-$starttime) , " ms\n"; // bench object method $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) $someObj->doTest($i); echo "Object Time: " , (microtime(true)-$starttime) , " ms\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 9
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 28
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 28
Branch analysis from position: 34
Branch analysis from position: 28
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 9
Branch analysis from position: 15
Branch analysis from position: 9
filename:       /in/EXN1a
function name:  (null)
number of ops:  42
compiled vars:  !0 = $someObj, !1 = $starttime, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $3      'SomeObj'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   17     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
   18     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->13
   19     9    >   INIT_STATIC_METHOD_CALL                                  'SomeClass', 'doTest'
         10        SEND_VAR                                                 !2
         11        DO_FCALL                                      0          
   18    12        PRE_INC                                                  !2
         13    >   IS_SMALLER                                               !2, 100000
         14      > JMPNZ                                                    ~11, ->9
   21    15    >   ECHO                                                     'Static+Time%3A+++'
         16        INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $12     
         19        SUB                                              ~13     $12, !1
         20        ECHO                                                     ~13
         21        ECHO                                                     '+ms%0A'
   24    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !1, $14
   26    26        ASSIGN                                                   !2, 0
         27      > JMP                                                      ->32
   27    28    >   INIT_METHOD_CALL                                         !0, 'doTest'
         29        SEND_VAR_EX                                              !2
         30        DO_FCALL                                      0          
   26    31        PRE_INC                                                  !2
         32    >   IS_SMALLER                                               !2, 10000000
         33      > JMPNZ                                                    ~19, ->28
   29    34    >   ECHO                                                     'Object+Time%3A+++'
         35        INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $20     
         38        SUB                                              ~21     $20, !1
         39        ECHO                                                     ~21
         40        ECHO                                                     '+ms%0A'
         41      > RETURN                                                   1

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

End of function dotest

End of class SomeObj.

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

End of function dotest

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.95 ms | 1400 KiB | 15 Q