3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variable = '1'; $tests = 10000; $time_start = microtime(true); for ($i=0; $i<$tests; $i++) { $bool = is_string($variable); } $time_end = microtime(true); $time = $time_end - $time_start; echo "is_string() in $time seconds\n"; $time_start = microtime(true); for ($i=0; $i<$tests; $i++) { $bool = is_scalar($variable); } $time_end = microtime(true); $time = $time_end - $time_start; echo "is_scalar() in $time seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 29
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 29
Branch analysis from position: 34
Branch analysis from position: 29
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/7mEPb
function name:  (null)
number of ops:  45
compiled vars:  !0 = $variable, !1 = $tests, !2 = $time_start, !3 = $i, !4 = $bool, !5 = $time_end, !6 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1'
    4     1        ASSIGN                                                   !1, 10000
    6     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !2, $9
    7     6        ASSIGN                                                   !3, 0
          7      > JMP                                                      ->11
    8     8    >   TYPE_CHECK                                   64  ~12     !0
          9        ASSIGN                                                   !4, ~12
    7    10        PRE_INC                                                  !3
         11    >   IS_SMALLER                                               !3, !1
         12      > JMPNZ                                                    ~15, ->8
   10    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $16     
         16        ASSIGN                                                   !5, $16
   11    17        SUB                                              ~18     !5, !2
         18        ASSIGN                                                   !6, ~18
   12    19        ROPE_INIT                                     3  ~21     'is_string%28%29+in+'
         20        ROPE_ADD                                      1  ~21     ~21, !6
         21        ROPE_END                                      2  ~20     ~21, '+seconds%0A'
         22        ECHO                                                     ~20
   14    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $23     
         26        ASSIGN                                                   !2, $23
   15    27        ASSIGN                                                   !3, 0
         28      > JMP                                                      ->32
   16    29    >   TYPE_CHECK                                  124  ~26     !0
         30        ASSIGN                                                   !4, ~26
   15    31        PRE_INC                                                  !3
         32    >   IS_SMALLER                                               !3, !1
         33      > JMPNZ                                                    ~29, ->29
   18    34    >   INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $30     
         37        ASSIGN                                                   !5, $30
   19    38        SUB                                              ~32     !5, !2
         39        ASSIGN                                                   !6, ~32
   20    40        ROPE_INIT                                     3  ~35     'is_scalar%28%29+in+'
         41        ROPE_ADD                                      1  ~35     ~35, !6
         42        ROPE_END                                      2  ~34     ~35, '+seconds%0A'
         43        ECHO                                                     ~34
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.24 ms | 1015 KiB | 14 Q