3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dostuff() { echo 'mb_check_encoding: '; $st = microtime( true ); $ans = mb_check_encoding( "\xF4\x90\x80\x80", 'UTF-8' ); $et = microtime( true ); echo $et - $st, 's '; var_dump( $ans ); echo 'preg_match: '; $st = microtime( true ); $ans = preg_match( '//u', "\xF4\x90\x80\x80" ); $et = microtime( true ); echo $et - $st, 's '; var_dump( $ans ); } dostuff();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GInQM
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'dostuff'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GInQM
function name:  dostuff
number of ops:  41
compiled vars:  !0 = $st, !1 = $ans, !2 = $et
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'mb_check_encoding%3A+'
    6     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    7     5        INIT_FCALL                                               'mb_check_encoding'
          6        SEND_VAL                                                 '%F4%90%80%80'
          7        SEND_VAL                                                 'UTF-8'
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    8    10        INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
    9    14        SUB                                              ~9      !2, !0
         15        ECHO                                                     ~9
         16        ECHO                                                     's+'
   10    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   12    20        ECHO                                                     'preg_match%3A+'
   13    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $11     
         24        ASSIGN                                                   !0, $11
   14    25        INIT_FCALL                                               'preg_match'
         26        SEND_VAL                                                 '%2F%2Fu'
         27        SEND_VAL                                                 '%F4%90%80%80'
         28        DO_ICALL                                         $13     
         29        ASSIGN                                                   !1, $13
   15    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $15     
         33        ASSIGN                                                   !2, $15
   16    34        SUB                                              ~17     !2, !0
         35        ECHO                                                     ~17
         36        ECHO                                                     's+'
   17    37        INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                                 
   19    40      > RETURN                                                   null

End of function dostuff

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.76 ms | 1394 KiB | 22 Q