3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TextTest { public function entities($str) { return substr($str,0); } } $answerset = array('answers'=>array(50=>array('answerlong'=>'somestring'))); $text = new TextTest(); ob_start(); $time = microtime(1); $i = 0; while($i++ < 10000) echo'<td>',$text->entities($answerSet['answers'][$questionId]['answerLong']),'</td>'; ob_end_clean(); echo (microtime(1)-$time)." seconds for commas"; echo "\n"; ob_start(); $time = microtime(1); $i = 0; while($i++ < 10000) echo'<td>'.$text->entities($answerSet['answers'][$questionId]['answerLong']).'</td>'; ob_end_clean(); echo (microtime(1)-$time)." seconds for dot";
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 = 25, Position 2 = 12
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 42
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 42
Branch analysis from position: 55
Branch analysis from position: 42
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 12
Branch analysis from position: 25
Branch analysis from position: 12
filename:       /in/t8tfU
function name:  (null)
number of ops:  64
compiled vars:  !0 = $answerset, !1 = $text, !2 = $time, !3 = $i, !4 = $answerSet, !5 = $questionId
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        NEW                                              $7      'TextTest'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    9     4        INIT_FCALL                                               'ob_start'
          5        DO_ICALL                                                 
   10     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !2, $11
   11    10        ASSIGN                                                   !3, 0
   12    11      > JMP                                                      ->22
         12    >   ECHO                                                     '%3Ctd%3E'
         13        INIT_METHOD_CALL                                         !1, 'entities'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $14     !4, 'answers'
         16        FETCH_DIM_FUNC_ARG                               $15     $14, !5
         17        FETCH_DIM_FUNC_ARG                               $16     $15, 'answerLong'
         18        SEND_FUNC_ARG                                            $16
         19        DO_FCALL                                      0  $17     
         20        ECHO                                                     $17
         21        ECHO                                                     '%3C%2Ftd%3E'
         22    >   POST_INC                                         ~18     !3
         23        IS_SMALLER                                               ~18, 10000
         24      > JMPNZ                                                    ~19, ->12
   13    25    >   INIT_FCALL                                               'ob_end_clean'
         26        DO_ICALL                                                 
   14    27        INIT_FCALL                                               'microtime'
         28        SEND_VAL                                                 1
         29        DO_ICALL                                         $21     
         30        SUB                                              ~22     $21, !2
         31        CONCAT                                           ~23     ~22, '+seconds+for+commas'
         32        ECHO                                                     ~23
   16    33        ECHO                                                     '%0A'
   18    34        INIT_FCALL                                               'ob_start'
         35        DO_ICALL                                                 
   19    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 1
         38        DO_ICALL                                         $25     
         39        ASSIGN                                                   !2, $25
   20    40        ASSIGN                                                   !3, 0
   21    41      > JMP                                                      ->52
         42    >   INIT_METHOD_CALL                                         !1, 'entities'
         43        CHECK_FUNC_ARG                                           
         44        FETCH_DIM_FUNC_ARG                               $28     !4, 'answers'
         45        FETCH_DIM_FUNC_ARG                               $29     $28, !5
         46        FETCH_DIM_FUNC_ARG                               $30     $29, 'answerLong'
         47        SEND_FUNC_ARG                                            $30
         48        DO_FCALL                                      0  $31     
         49        CONCAT                                           ~32     '%3Ctd%3E', $31
         50        CONCAT                                           ~33     ~32, '%3C%2Ftd%3E'
         51        ECHO                                                     ~33
         52    >   POST_INC                                         ~34     !3
         53        IS_SMALLER                                               ~34, 10000
         54      > JMPNZ                                                    ~35, ->42
   22    55    >   INIT_FCALL                                               'ob_end_clean'
         56        DO_ICALL                                                 
   23    57        INIT_FCALL                                               'microtime'
         58        SEND_VAL                                                 1
         59        DO_ICALL                                         $37     
         60        SUB                                              ~38     $37, !2
         61        CONCAT                                           ~39     ~38, '+seconds+for+dot'
         62        ECHO                                                     ~39
         63      > RETURN                                                   1

Class TextTest:
Function entities:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t8tfU
function name:  entities
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function entities

End of class TextTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.51 ms | 1400 KiB | 21 Q