3v4l.org

run code in 300+ PHP versions simultaneously
<?php $NUM = 10000000; $singleQuotedStringCode = "<?php '" . str_repeat('x', $NUM) . "';"; $doubleQuotedStringCode = '<?php "' . str_repeat('x', $NUM) . '";'; $startTime = microtime(true); token_get_all($singleQuotedStringCode); $endTime = microtime(true); echo 'Single quotes: ', $endTime - $startTime, ' seconds', "\n"; $startTime = microtime(true); token_get_all($doubleQuotedStringCode); $endTime = microtime(true); echo 'Double quotes: ', $endTime - $startTime, ' seconds', "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vuh7R
function name:  (null)
number of ops:  48
compiled vars:  !0 = $NUM, !1 = $singleQuotedStringCode, !2 = $doubleQuotedStringCode, !3 = $startTime, !4 = $endTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 10000000
    4     1        INIT_FCALL                                               'str_repeat'
          2        SEND_VAL                                                 'x'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        CONCAT                                           ~7      '%3C%3Fphp+%27', $6
          6        CONCAT                                           ~8      ~7, '%27%3B'
          7        ASSIGN                                                   !1, ~8
    5     8        INIT_FCALL                                               'str_repeat'
          9        SEND_VAL                                                 'x'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $10     
         12        CONCAT                                           ~11     '%3C%3Fphp+%22', $10
         13        CONCAT                                           ~12     ~11, '%22%3B'
         14        ASSIGN                                                   !2, ~12
    7    15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !3, $14
    8    19        INIT_FCALL                                               'token_get_all'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
    9    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $17     
         25        ASSIGN                                                   !4, $17
   11    26        ECHO                                                     'Single+quotes%3A+'
         27        SUB                                              ~19     !4, !3
         28        ECHO                                                     ~19
         29        ECHO                                                     '+seconds'
         30        ECHO                                                     '%0A'
   13    31        INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $20     
         34        ASSIGN                                                   !3, $20
   14    35        INIT_FCALL                                               'token_get_all'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                                 
   15    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $23     
         41        ASSIGN                                                   !4, $23
   17    42        ECHO                                                     'Double+quotes%3A+'
         43        SUB                                              ~25     !4, !3
         44        ECHO                                                     ~25
         45        ECHO                                                     '+seconds'
         46        ECHO                                                     '%0A'
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.06 ms | 1392 KiB | 19 Q