3v4l.org

run code in 300+ PHP versions simultaneously
<?php $digits = '1234567890'; $alnum = '123test'; /* $start = microtime(true); for ($i = 0; $i < 1000; $i++) { preg_match('/^\d+$/D', $digits); preg_match('/^\d+$/D', $alnum); } //printf("%F\n", microtime(true) - $start); */ //$start = microtime(true); for ($i = 0; $i < 1000; $i++) { strspn($digits, $digits) === strlen($digits); strspn($alnum, $digits) === strlen($alnum); } //printf("%F\n", microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
Branch analysis from position: 4
filename:       /in/U04sW
function name:  (null)
number of ops:  22
compiled vars:  !0 = $digits, !1 = $alnum, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1234567890'
    4     1        ASSIGN                                                   !1, '123test'
   14     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->19
   15     4    >   INIT_FCALL                                               'strspn'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        STRLEN                                           ~7      !0
          9        IS_IDENTICAL                                     ~8      $6, ~7
         10        FREE                                                     ~8
   16    11        INIT_FCALL                                               'strspn'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $9      
         15        STRLEN                                           ~10     !1
         16        IS_IDENTICAL                                     ~11     $9, ~10
         17        FREE                                                     ~11
   14    18        PRE_INC                                                  !2
         19    >   IS_SMALLER                                               !2, 1000
         20      > JMPNZ                                                    ~13, ->4
   18    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.55 ms | 1395 KiB | 15 Q